mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-03 13:44:22 -04:00
Fix build
This commit is contained in:
parent
914e891689
commit
1c74e2f40e
@ -107,7 +107,7 @@ namespace Emby.Server.Implementations.Collections
|
|||||||
|
|
||||||
var name = _localizationManager.GetLocalizedString("Collections");
|
var name = _localizationManager.GetLocalizedString("Collections");
|
||||||
|
|
||||||
await _libraryManager.AddVirtualFolder(name, CollectionType.BoxSets, libraryOptions, true).ConfigureAwait(false);
|
await _libraryManager.AddVirtualFolder(name, CollectionTypeOptions.BoxSets, libraryOptions, true).ConfigureAwait(false);
|
||||||
|
|
||||||
return FindFolders(path).First();
|
return FindFolders(path).First();
|
||||||
}
|
}
|
||||||
|
@ -1240,11 +1240,20 @@ namespace Emby.Server.Implementations.Library
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetCollectionType(string path)
|
private CollectionTypeOptions GetCollectionType(string path)
|
||||||
{
|
{
|
||||||
return _fileSystem.GetFilePaths(path, new[] { ".collection" }, true, false)
|
var files = _fileSystem.GetFilePaths(path, new[] { ".collection" }, true, false);
|
||||||
.Select(Path.GetFileNameWithoutExtension)
|
foreach (var file in files)
|
||||||
.FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
{
|
||||||
|
// TODO: @bond use a ReadOnlySpan<char> here when Enum.TryParse supports it
|
||||||
|
// https://github.com/dotnet/runtime/issues/20008
|
||||||
|
if (Enum.TryParse<CollectionTypeOptions>(Path.GetExtension(file), true, out var res))
|
||||||
|
{
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new FileNotFoundException("Coudn't find an appropriate collection type file.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2604,7 +2604,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||||||
{
|
{
|
||||||
Locations = new string[] { customPath },
|
Locations = new string[] { customPath },
|
||||||
Name = "Recorded Movies",
|
Name = "Recorded Movies",
|
||||||
CollectionType = CollectionType.Movies
|
CollectionType = CollectionTypeOptions.Movies
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2615,7 +2615,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||||||
{
|
{
|
||||||
Locations = new string[] { customPath },
|
Locations = new string[] { customPath },
|
||||||
Name = "Recorded Shows",
|
Name = "Recorded Shows",
|
||||||
CollectionType = CollectionType.TvShows
|
CollectionType = CollectionTypeOptions.TvShows
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,13 @@ namespace MediaBrowser.Model.Entities
|
|||||||
{
|
{
|
||||||
public enum CollectionTypeOptions
|
public enum CollectionTypeOptions
|
||||||
{
|
{
|
||||||
Movies,
|
Movies = 0,
|
||||||
Music,
|
TvShows = 1,
|
||||||
TvShows,
|
Music = 2,
|
||||||
Books,
|
MusicVideos = 3,
|
||||||
HomeVideos,
|
HomeVideos = 4,
|
||||||
MusicVideos,
|
BoxSets = 5,
|
||||||
Mixed
|
Books = 6,
|
||||||
|
Mixed = 7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ namespace MediaBrowser.Model.Entities
|
|||||||
/// Gets or sets the type of the collection.
|
/// Gets or sets the type of the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The type of the collection.</value>
|
/// <value>The type of the collection.</value>
|
||||||
public string CollectionType { get; set; }
|
public CollectionTypeOptions CollectionType { get; set; }
|
||||||
|
|
||||||
public LibraryOptions LibraryOptions { get; set; }
|
public LibraryOptions LibraryOptions { get; set; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user