Skip to content

Commit

Permalink
added skip directories
Browse files Browse the repository at this point in the history
  • Loading branch information
FireBall1725 committed Jun 29, 2024
1 parent 081e15a commit 3e3ca8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ca.fireball1725.lcs.discordbot.tasks.InviteProcessor
import ca.fireball1725.lcs.discordbot.tasks.MembersProcessor
import ca.fireball1725.lcs.discordbot.whitelist.WhitelistProcessor
import dev.kord.core.event.guild.MemberJoinEvent
import dev.kord.core.event.guild.MemberLeaveEvent
import dev.kord.core.event.message.MessageCreateEvent
import dev.kord.core.event.message.ReactionAddEvent
import dev.kord.core.event.message.ReactionRemoveEvent
Expand All @@ -30,5 +31,7 @@ fun registerListeners() =
on<MessageCreateEvent> { InviteProcessor().channelMessageEvent(this) } // check for invite metadata message
}

// Update the members table when someone joins or leaves
on<MemberJoinEvent> { MembersProcessor().updateMembersTable() }
on<MemberLeaveEvent> { MembersProcessor().updateMembersTable() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ class JsonStatsProcessor {
}

fun processServerDirectory(serverId: UUID, path: String, pterodactylId: UUID, isRoot: Boolean = false, inputTimestamp: OffsetDateTime = OffsetDateTime.now()) {
if (path.contains("lootr")) // skip lootr directory as we don't need this and it's large
val skipDirectories = listOf("lootr", "extended_drawers", "wiredredstone")
if (skipDirectories.any { path.contains(it) }) {
println("Skipping directory ${path}. It is in the skipDirectories list")
return
}

val pterodactylServerId = pterodactylId.toString().split("-")[0];

Expand Down Expand Up @@ -102,6 +105,8 @@ class JsonStatsProcessor {
// this is specific to vault hunters servers
processServerDirectory(it.server_id, "/playerSnapshots", it.pterodactyl_id, isRoot = true)
}

println("Finished with ${pterodactylId}")
}
}
}
Expand Down

0 comments on commit 3e3ca8f

Please sign in to comment.