Mark as unplayable instead of assigning to unplayable

This commit is contained in:
Ben Sarmiento
2024-02-17 13:01:09 +01:00
parent 511dfbb38b
commit b2067dfb81

View File

@@ -338,16 +338,18 @@ func (t *TorrentManager) assignedDirectoryCb(tor *Torrent, cb func(string)) {
unplayable = false
}
})
if unplayable {
t.markAsUnplayable(tor, "no playable files")
return
}
// Map torrents to directories
switch t.Config.GetVersion() {
case "v1":
configV1 := t.Config.(*config.ZurgConfigV1)
for _, directories := range configV1.GetGroupMap() {
for _, directory := range directories {
if unplayable {
cb(config.UNPLAYABLE_TORRENTS)
break
}
if t.Config.MeetsConditions(directory, t.GetKey(tor), tor.ComputeTotalSize(), torrentIDs, filenames, fileSizes) {
cb(directory)
break