Update supported video extensions
This commit is contained in:
@@ -233,8 +233,8 @@ func (t *TorrentManager) writeTorrentToFile(torrent *Torrent) {
|
||||
func (t *TorrentManager) applyMediaInfoDetails(torrent *Torrent) {
|
||||
changesApplied := false
|
||||
torrent.SelectedFiles.IterCb(func(_ string, file *File) {
|
||||
isPlayable := utils.IsPlayable(file.Path) || t.IsPlayable(file.Path)
|
||||
if file.MediaInfo != nil || file.State.Is("broken_file") || !isPlayable {
|
||||
isPlayable := utils.IsVideo(file.Path) || t.IsPlayable(file.Path)
|
||||
if file.MediaInfo != nil || !file.State.Is("ok_file") || !isPlayable {
|
||||
return
|
||||
}
|
||||
unrestrict := t.UnrestrictFileUntilOk(file, true)
|
||||
|
||||
@@ -357,7 +357,7 @@ func (t *TorrentManager) assignDirectory(tor *Torrent, triggerHook bool) {
|
||||
if file.MediaInfo != nil {
|
||||
mediaInfos = append(mediaInfos, file.MediaInfo)
|
||||
}
|
||||
if utils.IsPlayable(file.Path) || t.IsPlayable(file.Path) {
|
||||
if utils.IsVideo(file.Path) || t.IsPlayable(file.Path) {
|
||||
unplayable = false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -197,7 +197,7 @@ func (t *TorrentManager) repair(torrent *Torrent, wg *sync.WaitGroup) {
|
||||
// check if broken files are playable
|
||||
allPlayable := true
|
||||
for _, file := range brokenFiles {
|
||||
if utils.IsPlayable(file.Path) {
|
||||
if utils.IsVideo(file.Path) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ func (t *TorrentManager) assignLinks(torrent *Torrent) bool {
|
||||
if action == "extract" {
|
||||
videoFiles := []string{}
|
||||
torrent.SelectedFiles.IterCb(func(_ string, file *File) {
|
||||
if utils.IsPlayable(file.Path) {
|
||||
if utils.IsVideo(file.Path) {
|
||||
videoFiles = append(videoFiles, fmt.Sprintf("%d", file.ID))
|
||||
} else if file.ID != 0 {
|
||||
t.repairLog.Debugf("Extracting file %s from rar'ed torrent %s", file.Path, t.GetKey(torrent))
|
||||
|
||||
Reference in New Issue
Block a user