Mark as unplayable instead of assigning to unplayable
This commit is contained in:
@@ -338,16 +338,18 @@ func (t *TorrentManager) assignedDirectoryCb(tor *Torrent, cb func(string)) {
|
|||||||
unplayable = false
|
unplayable = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if unplayable {
|
||||||
|
t.markAsUnplayable(tor, "no playable files")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Map torrents to directories
|
// Map torrents to directories
|
||||||
switch t.Config.GetVersion() {
|
switch t.Config.GetVersion() {
|
||||||
case "v1":
|
case "v1":
|
||||||
configV1 := t.Config.(*config.ZurgConfigV1)
|
configV1 := t.Config.(*config.ZurgConfigV1)
|
||||||
for _, directories := range configV1.GetGroupMap() {
|
for _, directories := range configV1.GetGroupMap() {
|
||||||
for _, directory := range directories {
|
for _, directory := range directories {
|
||||||
if unplayable {
|
|
||||||
cb(config.UNPLAYABLE_TORRENTS)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if t.Config.MeetsConditions(directory, t.GetKey(tor), tor.ComputeTotalSize(), torrentIDs, filenames, fileSizes) {
|
if t.Config.MeetsConditions(directory, t.GetKey(tor), tor.ComputeTotalSize(), torrentIDs, filenames, fileSizes) {
|
||||||
cb(directory)
|
cb(directory)
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user