Additional playable extensions
This commit is contained in:
1
internal/torrent/rclone mount flags.txt
Normal file
1
internal/torrent/rclone mount flags.txt
Normal file
@@ -0,0 +1 @@
|
||||
dir-cache-time=10s --vfs-cache-mode full --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit 2G --buffer-size 52M --vfs-cache-max-age 150h --vfs-cache-max-size 370G --vfs-fast-fingerprint
|
||||
@@ -321,7 +321,7 @@ func (t *TorrentManager) assignedDirectoryCb(tor *Torrent, cb func(string)) {
|
||||
tor.SelectedFiles.IterCb(func(key string, file *File) {
|
||||
filenames = append(filenames, filepath.Base(file.Path))
|
||||
fileSizes = append(fileSizes, file.Bytes)
|
||||
if unplayable && utils.IsStreamable(file.Path) {
|
||||
if unplayable && (utils.IsPlayable(file.Path) || t.IsPlayable(file.Path)) {
|
||||
unplayable = false
|
||||
}
|
||||
})
|
||||
@@ -343,3 +343,14 @@ func (t *TorrentManager) assignedDirectoryCb(tor *Torrent, cb func(string)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TorrentManager) IsPlayable(filePath string) bool {
|
||||
filePath = strings.ToLower(filePath)
|
||||
playableExts := t.Config.GetPlayableExtensions()
|
||||
for _, ext := range playableExts {
|
||||
if strings.HasSuffix(filePath, fmt.Sprintf(".%s", ext)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user