improved file read/copy logic
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user