improved file read/copy logic

This commit is contained in:
zomo
2025-12-24 13:58:02 -06:00
parent 658ad890f5
commit 32ed104b60
10 changed files with 337 additions and 153 deletions

View File

@@ -4,22 +4,22 @@ func AssignExtraRooms(rooms []RoomFolder, roomsPerNight int) {
latestnight := 0
for _, r := range rooms {
if r.cfg.night > latestnight {
latestnight = r.cfg.night
if r.Cfg.night > latestnight {
latestnight = r.Cfg.night
}
}
night := latestnight + 1
room := 1
for i, r := range rooms {
if r.cfg.night > 0 {
if r.Cfg.night > 0 {
continue
}
rooms[i].cfg.night = night
rooms[i].cfg.room = room
rooms[i].Cfg.night = night
rooms[i].Cfg.room = room
room++
if room > roomsPerNight {
room = 1