Mount youtube videos properly
This commit is contained in:
@@ -341,6 +341,16 @@ func (t *TorrentManager) mountNewDownloads() {
|
||||
isRealDebrid := strings.HasPrefix(downloads[i].Link, "https://real-debrid.com/d/")
|
||||
if !isRealDebrid {
|
||||
filename := filepath.Base(downloads[i].Filename)
|
||||
if strings.Contains(downloads[i].Type, "x") {
|
||||
// extract extension from the filename
|
||||
ext := filepath.Ext(filename)
|
||||
trimmed := strings.TrimSuffix(filename, ext)
|
||||
// it's a resolution so extract 2nd part and add it to the filename
|
||||
parts := strings.Split(downloads[i].Type, "x")
|
||||
if len(parts) > 1 {
|
||||
filename = fmt.Sprintf("%s (%sp)%s", trimmed, parts[1], ext)
|
||||
}
|
||||
}
|
||||
t.DownloadMap.Set(filename, &downloads[i])
|
||||
mountedCount++
|
||||
} else if token != "" {
|
||||
|
||||
Reference in New Issue
Block a user