mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
completed multiple movie in folder support
This commit is contained in:
@@ -242,16 +242,9 @@ namespace MediaBrowser.Server.Implementations.Providers
|
||||
|
||||
if (saveLocally)
|
||||
{
|
||||
if (!(item is Episode))
|
||||
if (item.IsInMixedFolder && !(item is Episode))
|
||||
{
|
||||
var video = item as Video;
|
||||
|
||||
if (video != null && video.IsInMixedFolder)
|
||||
{
|
||||
var folder = Path.GetDirectoryName(video.Path);
|
||||
|
||||
path = Path.Combine(folder, Path.GetFileNameWithoutExtension(video.Path) + "-" + filename);
|
||||
}
|
||||
path = GetSavePathForItemInMixedFolder(item, type, filename, extension);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(path) && !string.IsNullOrEmpty(item.MetaLocation))
|
||||
@@ -260,6 +253,7 @@ namespace MediaBrowser.Server.Implementations.Providers
|
||||
}
|
||||
}
|
||||
|
||||
// None of the save local conditions passed, so store it in our internal folders
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
path = _remoteImageCache.GetResourcePath(item.GetType().FullName + item.Id, filename);
|
||||
@@ -274,5 +268,16 @@ namespace MediaBrowser.Server.Implementations.Providers
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
private string GetSavePathForItemInMixedFolder(BaseItem item, ImageType type, string imageFilename, string extension)
|
||||
{
|
||||
if (type == ImageType.Primary)
|
||||
{
|
||||
return Path.ChangeExtension(item.Path, extension);
|
||||
}
|
||||
var folder = Path.GetDirectoryName(item.Path);
|
||||
|
||||
return Path.Combine(folder, Path.GetFileNameWithoutExtension(item.Path) + "-" + imageFilename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user