@@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.5.002.0
|
VisualStudioVersion = 17.5.002.0
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StreamCinemaLib", "StreamCinemaLib\StreamCinemaLib.csproj", "{7DE997A9-52B8-41E4-9958-1115BA3E481D}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CinemaLib", "CinemaLib\CinemaLib.csproj", "{7DE997A9-52B8-41E4-9958-1115BA3E481D}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StreamCinemaWeb", "StreamCinemaWeb\StreamCinemaWeb.csproj", "{6B2550AF-200C-40B3-95AE-892A604B9A76}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CinemaWeb", "CinemaWeb\CinemaWeb.csproj", "{6B2550AF-200C-40B3-95AE-892A604B9A76}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreamCinemaJellyfin", "StreamCinemaJellyfin\StreamCinemaJellyfin.csproj", "{E106C0D2-788D-4401-A9F0-9D0A35E8BB63}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CinemaJellyfin", "CinemaJellyfin\CinemaJellyfin.csproj", "{E106C0D2-788D-4401-A9F0-9D0A35E8BB63}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -6,14 +6,14 @@ using MediaBrowser.Controller.Entities.Audio;
|
|||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Querying;
|
using MediaBrowser.Model.Querying;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stream Cinema folder that also implicitly represents a filter (minimally filter by <see cref="ItemType"/>).
|
/// Stream Cinema folder that also implicitly represents a filter (minimally filter by <see cref="ItemType"/>).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class StreamCinemaFilterFolder : Folder
|
public abstract class CinemaFilterFolder : Folder
|
||||||
{
|
{
|
||||||
private const string PreferredCulture = "cs";
|
private const string PreferredCulture = "cs";
|
||||||
private const string FallbackCulture = "en";
|
private const string FallbackCulture = "en";
|
||||||
@@ -45,7 +45,7 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
public abstract ItemType ItemType { get; }
|
public abstract ItemType ItemType { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Information for <see cref="StreamCinemaImageProvider"/> to render icon for us.
|
/// Information for <see cref="CinemaImageProvider"/> to render icon for us.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal abstract string ImageName { get; }
|
internal abstract string ImageName { get; }
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T">Type of the folder.</typeparam>
|
/// <typeparam name="T">Type of the folder.</typeparam>
|
||||||
/// <param name="localizedName">Culture localized name of the folder.</param>
|
/// <param name="localizedName">Culture localized name of the folder.</param>
|
||||||
protected T CreateChildFolder<T>(string localizedName) where T : StreamCinemaFilterFolder, new()
|
protected T CreateChildFolder<T>(string localizedName) where T : CinemaFilterFolder, new()
|
||||||
{
|
{
|
||||||
return CreateFilterFolderInternal<T>(this, localizedName);
|
return CreateFilterFolderInternal<T>(this, localizedName);
|
||||||
}
|
}
|
||||||
@@ -169,18 +169,18 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
/// <typeparam name="T">Type of the folder.</typeparam>
|
/// <typeparam name="T">Type of the folder.</typeparam>
|
||||||
/// <param name="parent">Parent folder.</param>
|
/// <param name="parent">Parent folder.</param>
|
||||||
/// <param name="localizedName">Culture localized name of the folder.</param>
|
/// <param name="localizedName">Culture localized name of the folder.</param>
|
||||||
internal static T CreateRootFilterFolder<T>(string localizedName) where T : StreamCinemaRootFolder, new()
|
internal static T CreateRootFilterFolder<T>(string localizedName) where T : CinemaRootFolder, new()
|
||||||
{
|
{
|
||||||
return CreateFilterFolderInternal<T>(null, localizedName);
|
return CreateFilterFolderInternal<T>(null, localizedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static T CreateFilterFolderInternal<T>(StreamCinemaFilterFolder? parent, string localizedName) where T : StreamCinemaFilterFolder, new()
|
private static T CreateFilterFolderInternal<T>(CinemaFilterFolder? parent, string localizedName) where T : CinemaFilterFolder, new()
|
||||||
{
|
{
|
||||||
Guid folderId = StreamCinemaHost.LibraryManager.GetNewItemId("folder", typeof(T));
|
Guid folderId = CinemaHost.LibraryManager.GetNewItemId("folder", typeof(T));
|
||||||
string folderPath = GetInternalMetadataPath(StreamCinemaHost.InternalMetadataPath!, folderId);
|
string folderPath = GetInternalMetadataPath(CinemaHost.InternalMetadataPath!, folderId);
|
||||||
Directory.CreateDirectory(folderPath);
|
Directory.CreateDirectory(folderPath);
|
||||||
|
|
||||||
T? folder = StreamCinemaHost.LibraryManager.GetItemById(folderId) as T;
|
T? folder = CinemaHost.LibraryManager.GetItemById(folderId) as T;
|
||||||
bool isNew;
|
bool isNew;
|
||||||
bool forceUpdate = false;
|
bool forceUpdate = false;
|
||||||
if (isNew = folder == null)
|
if (isNew = folder == null)
|
||||||
@@ -189,8 +189,8 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
{
|
{
|
||||||
Id = folderId,
|
Id = folderId,
|
||||||
Name = localizedName,
|
Name = localizedName,
|
||||||
DateCreated = StreamCinemaHost.FileSystem.GetCreationTimeUtc(folderPath),
|
DateCreated = CinemaHost.FileSystem.GetCreationTimeUtc(folderPath),
|
||||||
DateModified = StreamCinemaHost.FileSystem.GetLastWriteTimeUtc(folderPath)
|
DateModified = CinemaHost.FileSystem.GetLastWriteTimeUtc(folderPath)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
{
|
{
|
||||||
folder.ParentId = Guid.Empty;
|
folder.ParentId = Guid.Empty;
|
||||||
folder.IsRoot = true;
|
folder.IsRoot = true;
|
||||||
StreamCinemaHost.LibraryManager.RootFolder.AddVirtualChild(folder);
|
CinemaHost.LibraryManager.RootFolder.AddVirtualChild(folder);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -210,11 +210,11 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
if (isNew)
|
if (isNew)
|
||||||
{
|
{
|
||||||
folder.OnMetadataChanged();
|
folder.OnMetadataChanged();
|
||||||
StreamCinemaHost.LibraryManager.CreateItem(folder, parent);
|
CinemaHost.LibraryManager.CreateItem(folder, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
folder.RefreshMetadata(
|
folder.RefreshMetadata(
|
||||||
new MetadataRefreshOptions(new DirectoryService(StreamCinemaHost.FileSystem)) { ForceSave = !isNew && forceUpdate },
|
new MetadataRefreshOptions(new DirectoryService(CinemaHost.FileSystem)) { ForceSave = !isNew && forceUpdate },
|
||||||
default
|
default
|
||||||
).GetAwaiter().GetResult();
|
).GetAwaiter().GetResult();
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item = GetMediaItemById<StreamCinemaMovie>(csId, null, out isNew);
|
item = GetMediaItemById<CinemaMovie>(csId, null, out isNew);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNew && media.info_labels != null)
|
if (isNew && media.info_labels != null)
|
||||||
@@ -324,11 +324,11 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Identify the item as it originates from StreamCinema
|
// Identify the item as it originates from Cinema
|
||||||
// Note: This is getting lost in persisted items
|
// Note: This is getting lost in persisted items
|
||||||
if (item.ProviderIds == null)
|
if (item.ProviderIds == null)
|
||||||
item.ProviderIds = new Dictionary<string, string>();
|
item.ProviderIds = new Dictionary<string, string>();
|
||||||
item.ProviderIds[StreamCinemaPlugin.StreamCinemaProviderName] = "";
|
item.ProviderIds[CinemaPlugin.CinemaProviderName] = "";
|
||||||
|
|
||||||
item.Path = "https://a/b";
|
item.Path = "https://a/b";
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
{
|
{
|
||||||
// HACK: We use RegisterItem that is volatile intead of CreateItem
|
// HACK: We use RegisterItem that is volatile intead of CreateItem
|
||||||
//_libraryManager.CreateItem(item, parentFolder);
|
//_libraryManager.CreateItem(item, parentFolder);
|
||||||
StreamCinemaHost.LibraryManager.RegisterItem(item);
|
CinemaHost.LibraryManager.RegisterItem(item);
|
||||||
|
|
||||||
if (media.cast != null && media.cast.Count > 0)
|
if (media.cast != null && media.cast.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -451,7 +451,7 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
|
|
||||||
internal static string GetInternalMetadataPath(string basePath, Guid id)
|
internal static string GetInternalMetadataPath(string basePath, Guid id)
|
||||||
{
|
{
|
||||||
return System.IO.Path.Combine(basePath, "streamcinema", id.ToString("N", CultureInfo.InvariantCulture), "metadata");
|
return System.IO.Path.Combine(basePath, "cinema", id.ToString("N", CultureInfo.InvariantCulture), "metadata");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -459,7 +459,7 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal static Guid GetMediaItemId(string csPrimaryId, string? csVersionId) {
|
internal static Guid GetMediaItemId(string csPrimaryId, string? csVersionId) {
|
||||||
string idS = csVersionId == null ? csPrimaryId : (csPrimaryId + VersionSeparator + csVersionId);
|
string idS = csVersionId == null ? csPrimaryId : (csPrimaryId + VersionSeparator + csVersionId);
|
||||||
return StreamCinemaHost.LibraryManager.GetNewItemId(idS, typeof(StreamCinemaPlugin));
|
return CinemaHost.LibraryManager.GetNewItemId(idS, typeof(CinemaPlugin));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -469,7 +469,7 @@ public abstract class StreamCinemaFilterFolder : Folder
|
|||||||
where T : BaseItem, new()
|
where T : BaseItem, new()
|
||||||
{
|
{
|
||||||
Guid id = GetMediaItemId(csPrimaryId, csVersionId);
|
Guid id = GetMediaItemId(csPrimaryId, csVersionId);
|
||||||
T? item = StreamCinemaHost.LibraryManager.GetItemById(id) as T;
|
T? item = CinemaHost.LibraryManager.GetItemById(id) as T;
|
||||||
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
@@ -5,26 +5,26 @@ using MediaBrowser.Model.IO;
|
|||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <see cref="IHostedService"/> responsible for Live TV recordings.
|
/// <see cref="IHostedService"/> responsible for Live TV recordings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class StreamCinemaHost : IHostedService
|
public sealed class CinemaHost : IHostedService
|
||||||
{
|
{
|
||||||
#pragma warning disable CS8618
|
#pragma warning disable CS8618
|
||||||
// This instance is specially registered and gets created before all classes
|
// This instance is specially registered and gets created before all classes
|
||||||
// except StreamCinemaSeccviceRegistrator and StreamCinemaPlugin.
|
// except CinemaServiceRegistrator and CinemaPlugin.
|
||||||
private static ILibraryManager _libraryManager;
|
private static ILibraryManager _libraryManager;
|
||||||
private static IServerConfigurationManager _config;
|
private static IServerConfigurationManager _config;
|
||||||
private static IFileSystem _fileSystem;
|
private static IFileSystem _fileSystem;
|
||||||
#pragma warning restore CS8618
|
#pragma warning restore CS8618
|
||||||
private readonly ILogger<StreamCinemaHost> _logger;
|
private readonly ILogger<CinemaHost> _logger;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a the Stream Cinema plugin.
|
/// Initializes a the Stream Cinema plugin.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public StreamCinemaHost(ILibraryManager libraryManager, IServerConfigurationManager config, IFileSystem fileSystem, ILogger<StreamCinemaHost> logger)
|
public CinemaHost(ILibraryManager libraryManager, IServerConfigurationManager config, IFileSystem fileSystem, ILogger<CinemaHost> logger)
|
||||||
{
|
{
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
_config = config;
|
_config = config;
|
||||||
@@ -42,7 +42,7 @@ public sealed class StreamCinemaHost : IHostedService
|
|||||||
public Task StartAsync(CancellationToken cancellationToken)
|
public Task StartAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// Make sure the Stream Cinema root folders are created
|
// Make sure the Stream Cinema root folders are created
|
||||||
StreamCinemaFilterFolder.CreateRootFilterFolder<StreamCinemaMoviesFolder>("Movies");
|
CinemaFilterFolder.CreateRootFilterFolder<CinemaMoviesFolder>("Movies");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
pluginItems.Add(CreateMenuItem("movies", Resources.Movies, GetResourceUrl("movies.png")));
|
pluginItems.Add(CreateMenuItem("movies", Resources.Movies, GetResourceUrl("movies.png")));
|
||||||
@@ -2,16 +2,16 @@ using MediaBrowser.Controller.Entities;
|
|||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An image provider for Stream Cinema icons.
|
/// An image provider for Cinema icons.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StreamCinemaImageProvider : IDynamicImageProvider
|
public class CinemaImageProvider : IDynamicImageProvider
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Name => "Stream Cinema Image Provider";
|
public string Name => "Cinema Image Provider";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
|
public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
|
||||||
@@ -22,8 +22,8 @@ public class StreamCinemaImageProvider : IDynamicImageProvider
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task<DynamicImageResponse> GetImage(BaseItem item, ImageType type, CancellationToken cancellationToken)
|
public Task<DynamicImageResponse> GetImage(BaseItem item, ImageType type, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (item is StreamCinemaFilterFolder filter)
|
if (item is CinemaFilterFolder filter)
|
||||||
return Task.FromResult(new DynamicImageResponse() { HasImage = true, Stream = typeof(StreamCinemaImageProvider).Assembly.GetManifestResourceStream(typeof(StreamCinemaImageProvider), filter.ImageName) });
|
return Task.FromResult(new DynamicImageResponse() { HasImage = true, Stream = typeof(CinemaImageProvider).Assembly.GetManifestResourceStream(typeof(CinemaImageProvider), filter.ImageName) });
|
||||||
else
|
else
|
||||||
return Task.FromResult(new DynamicImageResponse() { HasImage = false });
|
return Task.FromResult(new DynamicImageResponse() { HasImage = false });
|
||||||
}
|
}
|
||||||
@@ -31,6 +31,6 @@ public class StreamCinemaImageProvider : IDynamicImageProvider
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Supports(BaseItem item)
|
public bool Supports(BaseItem item)
|
||||||
{
|
{
|
||||||
return item is StreamCinemaFilterFolder;
|
return item is CinemaFilterFolder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
12
CinemaJellyfin/CinemaInnerMediaSourceManager.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
|
class CinemaInnerMediaSourceManager : ICinemaInnerMediaSourceManager
|
||||||
|
{
|
||||||
|
private readonly Type _innerType;
|
||||||
|
|
||||||
|
public CinemaInnerMediaSourceManager(Type innerType) {
|
||||||
|
this._innerType = innerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Type InnerType => _innerType;
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\StreamCinemaLib/StreamCinemaLib.csproj" />
|
<ProjectReference Include="..\CinemaLib\CinemaLib.csproj" />
|
||||||
<PackageReference Include="Jellyfin.Controller" Version="10.10.3" />
|
<PackageReference Include="Jellyfin.Controller" Version="10.10.3" />
|
||||||
<!--ProjectReference Include="..\..\..\jellyfin/MediaBrowser.Controller\MediaBrowser.Controller.csproj" /-->
|
<!--ProjectReference Include="..\..\..\jellyfin/MediaBrowser.Controller\MediaBrowser.Controller.csproj" /-->
|
||||||
<PackageReference Include="Jellyfin.Model" Version="10.10.3" />
|
<PackageReference Include="Jellyfin.Model" Version="10.10.3" />
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Debug'">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Debug'">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DebugCopyFiles Include="$(TargetDir)\StreamCinema*.dll" />
|
<DebugCopyFiles Include="$(TargetDir)\Cinema*.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<MakeDir Directories="\home\code\.local\share\jellyfin\plugins\StreamCinema" />
|
<MakeDir Directories="\home\code\.local\share\jellyfin\plugins\Cinema" />
|
||||||
<Copy SourceFiles="@(DebugCopyFiles)" DestinationFolder="\home\code\.local\share\jellyfin\plugins\StreamCinema" />
|
<Copy SourceFiles="@(DebugCopyFiles)" DestinationFolder="\home\code\.local\share\jellyfin\plugins\Cinema" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -16,12 +16,12 @@ using MediaBrowser.Model.Entities;
|
|||||||
using MediaBrowser.Model.MediaInfo;
|
using MediaBrowser.Model.MediaInfo;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Primitives;
|
using Microsoft.Extensions.Primitives;
|
||||||
using StreamCinema.Webshare;
|
using Cinema.Webshare;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
public class CinemaMediaSourceManager : IMediaSourceManager
|
||||||
{
|
{
|
||||||
private const bool IsWebshareFreeAccount = true;
|
private const bool IsWebshareFreeAccount = true;
|
||||||
private const double BitrateMargin = 0.1; // 10 %
|
private const double BitrateMargin = 0.1; // 10 %
|
||||||
@@ -29,14 +29,14 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
|
|
||||||
private static readonly TimeSpan VersionValidityTimeout = TimeSpan.FromMinutes(180);
|
private static readonly TimeSpan VersionValidityTimeout = TimeSpan.FromMinutes(180);
|
||||||
|
|
||||||
private static StreamCinemaMediaSourceManager? _instance;
|
private static CinemaMediaSourceManager? _instance;
|
||||||
|
|
||||||
private readonly IMediaSourceManager _inner;
|
private readonly IMediaSourceManager _inner;
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly IHttpContextAccessor _http;
|
private readonly IHttpContextAccessor _http;
|
||||||
private readonly ConcurrentDictionary<Guid, VersionSetEntry> _videoVersions;
|
private readonly ConcurrentDictionary<Guid, VersionSetEntry> _videoVersions;
|
||||||
|
|
||||||
public StreamCinemaMediaSourceManager(IStreamCinemaInnerMediaSourceManager innerMediaSourceManager, ILibraryManager libraryManager, IServiceProvider svc, IHttpContextAccessor http)
|
public CinemaMediaSourceManager(ICinemaInnerMediaSourceManager innerMediaSourceManager, ILibraryManager libraryManager, IServiceProvider svc, IHttpContextAccessor http)
|
||||||
{
|
{
|
||||||
if (innerMediaSourceManager == null || svc == null)
|
if (innerMediaSourceManager == null || svc == null)
|
||||||
throw new ArgumentNullException();
|
throw new ArgumentNullException();
|
||||||
@@ -53,7 +53,7 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
_instance = this;
|
_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool TryGetInstance([NotNullWhen(true)] out StreamCinemaMediaSourceManager? instance)
|
internal static bool TryGetInstance([NotNullWhen(true)] out CinemaMediaSourceManager? instance)
|
||||||
{
|
{
|
||||||
instance = _instance;
|
instance = _instance;
|
||||||
return instance != null;
|
return instance != null;
|
||||||
@@ -120,15 +120,15 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
{
|
{
|
||||||
return _inner.GetMediaStreams(itemId);
|
return _inner.GetMediaStreams(itemId);
|
||||||
/*
|
/*
|
||||||
// Intercept for StreamCinemaItems
|
// Intercept for CinemaItems
|
||||||
Video? item = _libraryManager.GetItemById<Video>(itemId);
|
Video? item = _libraryManager.GetItemById<Video>(itemId);
|
||||||
if (item == null
|
if (item == null
|
||||||
|| item.ProviderIds == null
|
|| item.ProviderIds == null
|
||||||
|| !item.ProviderIds.ContainsKey(StreamCinemaPlugin.StreamCinemaProviderName)
|
|| !item.ProviderIds.ContainsKey(CinemaPlugin.CinemaProviderName)
|
||||||
|| string.IsNullOrEmpty(item.ExternalId))
|
|| string.IsNullOrEmpty(item.ExternalId))
|
||||||
return _inner.GetMediaStreams(itemId);
|
return _inner.GetMediaStreams(itemId);
|
||||||
|
|
||||||
StreamCinemaLib.API.Stream? ver = GetVersion(item, default).GetAwaiter().GetResult();
|
CinemaLib.API.Stream? ver = GetVersion(item, default).GetAwaiter().GetResult();
|
||||||
|
|
||||||
return ver != null ? VersionToMediaStreams(item, ver) : new List<MediaStream>();
|
return ver != null ? VersionToMediaStreams(item, ver) : new List<MediaStream>();
|
||||||
*/
|
*/
|
||||||
@@ -151,10 +151,10 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
|
|
||||||
public List<MediaSourceInfo> GetStaticMediaSources(BaseItem item, bool enablePathSubstitution, User? user = null)
|
public List<MediaSourceInfo> GetStaticMediaSources(BaseItem item, bool enablePathSubstitution, User? user = null)
|
||||||
{
|
{
|
||||||
// Intercept for StreamCinemaItems
|
// Intercept for CinemaItems
|
||||||
if (item == null
|
if (item == null
|
||||||
|| item.ProviderIds == null
|
|| item.ProviderIds == null
|
||||||
|| !item.ProviderIds.ContainsKey(StreamCinemaPlugin.StreamCinemaProviderName)
|
|| !item.ProviderIds.ContainsKey(CinemaPlugin.CinemaProviderName)
|
||||||
|| string.IsNullOrEmpty(item.ExternalId))
|
|| string.IsNullOrEmpty(item.ExternalId))
|
||||||
return _inner.GetStaticMediaSources(item, enablePathSubstitution, user);
|
return _inner.GetStaticMediaSources(item, enablePathSubstitution, user);
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
IEnumerable<Video> items;
|
IEnumerable<Video> items;
|
||||||
switch (video)
|
switch (video)
|
||||||
{
|
{
|
||||||
case StreamCinemaMovie movie: items = GetVideoVersionsEnumerate<StreamCinemaMovie>(movie, videoPrimary!, ver.Versions); break;
|
case CinemaMovie movie: items = GetVideoVersionsEnumerate<CinemaMovie>(movie, videoPrimary!, ver.Versions); break;
|
||||||
default: throw new NotSupportedException(string.Format("BaseItem type '{0}' not supported in CinemaMediaSources.", video.GetType().Name));
|
default: throw new NotSupportedException(string.Format("BaseItem type '{0}' not supported in CinemaMediaSources.", video.GetType().Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,10 +190,10 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
|
|
||||||
public async Task<List<MediaSourceInfo>> GetPlaybackMediaSources(BaseItem item, User user, bool allowMediaProbe, bool enablePathSubstitution, CancellationToken cancellationToken)
|
public async Task<List<MediaSourceInfo>> GetPlaybackMediaSources(BaseItem item, User user, bool allowMediaProbe, bool enablePathSubstitution, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// Intercept for StreamCinemaItems
|
// Intercept for CinemaItems
|
||||||
if (item == null
|
if (item == null
|
||||||
|| item.ProviderIds == null
|
|| item.ProviderIds == null
|
||||||
|| !item.ProviderIds.ContainsKey(StreamCinemaPlugin.StreamCinemaProviderName)
|
|| !item.ProviderIds.ContainsKey(CinemaPlugin.CinemaProviderName)
|
||||||
|| string.IsNullOrEmpty(item.ExternalId))
|
|| string.IsNullOrEmpty(item.ExternalId))
|
||||||
return await _inner.GetPlaybackMediaSources(item, user, allowMediaProbe, enablePathSubstitution, cancellationToken);
|
return await _inner.GetPlaybackMediaSources(item, user, allowMediaProbe, enablePathSubstitution, cancellationToken);
|
||||||
|
|
||||||
@@ -301,7 +301,7 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
a = StreamCinemaFilterFolder.GetMediaItemById<T>(item.ExternalId, i.Meta._id, out bool isNew);
|
a = CinemaFilterFolder.GetMediaItemById<T>(item.ExternalId, i.Meta._id, out bool isNew);
|
||||||
if (isNew)
|
if (isNew)
|
||||||
{
|
{
|
||||||
// Copy properties from the parent version
|
// Copy properties from the parent version
|
||||||
@@ -328,7 +328,7 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
throw new ArgumentNullException();
|
throw new ArgumentNullException();
|
||||||
|
|
||||||
if (item.ProviderIds == null
|
if (item.ProviderIds == null
|
||||||
|| !item.ProviderIds.ContainsKey(StreamCinemaPlugin.StreamCinemaProviderName)
|
|| !item.ProviderIds.ContainsKey(CinemaPlugin.CinemaProviderName)
|
||||||
|| string.IsNullOrEmpty(item.ExternalId))
|
|| string.IsNullOrEmpty(item.ExternalId))
|
||||||
{
|
{
|
||||||
// Not a Stream Cinema video
|
// Not a Stream Cinema video
|
||||||
@@ -345,7 +345,7 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
primary = _libraryManager.GetItemById(primaryId);
|
primary = _libraryManager.GetItemById(primaryId);
|
||||||
if (primary == null
|
if (primary == null
|
||||||
|| primary.ProviderIds == null
|
|| primary.ProviderIds == null
|
||||||
|| !primary.ProviderIds.ContainsKey(StreamCinemaPlugin.StreamCinemaProviderName)
|
|| !primary.ProviderIds.ContainsKey(CinemaPlugin.CinemaProviderName)
|
||||||
|| string.IsNullOrEmpty(primary.ExternalId))
|
|| string.IsNullOrEmpty(primary.ExternalId))
|
||||||
// Not a Stream Cinema video
|
// Not a Stream Cinema video
|
||||||
return Task.FromResult<VersionSetEntry>(default);
|
return Task.FromResult<VersionSetEntry>(default);
|
||||||
@@ -399,7 +399,7 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
id = primary!.Id;
|
id = primary!.Id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
id = StreamCinemaFilterFolder.GetMediaItemId(primary!.ExternalId, i.Meta._id);
|
id = CinemaFilterFolder.GetMediaItemId(primary!.ExternalId, i.Meta._id);
|
||||||
|
|
||||||
if (id == item.Id)
|
if (id == item.Id)
|
||||||
return i;
|
return i;
|
||||||
@@ -419,7 +419,7 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
return GetVersionInfo(item, ver.Meta);
|
return GetVersionInfo(item, ver.Meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
private MediaSourceInfo GetVersionInfo(Video item, StreamCinemaLib.API.Stream ver)
|
private MediaSourceInfo GetVersionInfo(Video item, CinemaLib.API.Stream ver)
|
||||||
{
|
{
|
||||||
MediaSourceInfo result = new MediaSourceInfo();
|
MediaSourceInfo result = new MediaSourceInfo();
|
||||||
result.VideoType = VideoType.VideoFile;
|
result.VideoType = VideoType.VideoFile;
|
||||||
@@ -478,7 +478,7 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<MediaStream> VersionToMediaStreams(Video item, StreamCinemaLib.API.Stream ver)
|
private static List<MediaStream> VersionToMediaStreams(Video item, CinemaLib.API.Stream ver)
|
||||||
{
|
{
|
||||||
List<MediaStream> result = new List<MediaStream>();
|
List<MediaStream> result = new List<MediaStream>();
|
||||||
// HACK: Propagate some values to the item also
|
// HACK: Propagate some values to the item also
|
||||||
@@ -601,14 +601,14 @@ public class StreamCinemaMediaSourceManager : IMediaSourceManager
|
|||||||
|
|
||||||
class VersionEntry
|
class VersionEntry
|
||||||
{
|
{
|
||||||
private readonly StreamCinemaLib.API.Stream _meta;
|
private readonly CinemaLib.API.Stream _meta;
|
||||||
|
|
||||||
internal VersionEntry(StreamCinemaLib.API.Stream meta)
|
internal VersionEntry(CinemaLib.API.Stream meta)
|
||||||
{
|
{
|
||||||
this._meta = meta;
|
this._meta = meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal StreamCinemaLib.API.Stream Meta => _meta;
|
internal CinemaLib.API.Stream Meta => _meta;
|
||||||
|
|
||||||
internal Uri? DownloadLink { get; set; }
|
internal Uri? DownloadLink { get; set; }
|
||||||
}
|
}
|
||||||
@@ -4,14 +4,14 @@ using MediaBrowser.Controller.Entities;
|
|||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Media source provider for for Stream Cinema media items.
|
/// Media source provider for for Cinema media items.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StreamCinemaMediaSourceProvider : IMediaSourceProvider
|
public class CinemaMediaSourceProvider : IMediaSourceProvider
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(BaseItem item, CancellationToken cancellationToken)
|
public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(BaseItem item, CancellationToken cancellationToken)
|
||||||
@@ -7,16 +7,16 @@ using MediaBrowser.Controller.Providers;
|
|||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Metadata service that recognizes the StreamCinemaFilterFolder folders.
|
/// Metadata service that recognizes the CinemaFilterFolder folders.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StreamCinemaMetadataService : IMetadataService
|
public class CinemaMetadataService : IMetadataService
|
||||||
{
|
{
|
||||||
public StreamCinemaMetadataService(
|
public CinemaMetadataService(
|
||||||
IServerConfigurationManager serverConfigurationManager,
|
IServerConfigurationManager serverConfigurationManager,
|
||||||
ILogger<StreamCinemaMetadataService> logger,
|
ILogger<CinemaMetadataService> logger,
|
||||||
IProviderManager providerManager,
|
IProviderManager providerManager,
|
||||||
IFileSystem fileSystem,
|
IFileSystem fileSystem,
|
||||||
ILibraryManager libraryManager)
|
ILibraryManager libraryManager)
|
||||||
@@ -27,17 +27,17 @@ public class StreamCinemaMetadataService : IMetadataService
|
|||||||
|
|
||||||
public bool CanRefresh(BaseItem item)
|
public bool CanRefresh(BaseItem item)
|
||||||
{
|
{
|
||||||
return item is StreamCinemaFilterFolder;
|
return item is CinemaFilterFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanRefreshPrimary(Type type)
|
public bool CanRefreshPrimary(Type type)
|
||||||
{
|
{
|
||||||
return typeof(StreamCinemaFilterFolder).IsAssignableFrom(type);
|
return typeof(CinemaFilterFolder).IsAssignableFrom(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<ItemUpdateType> RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
|
public Task<ItemUpdateType> RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var itemOfType = (StreamCinemaFilterFolder)item;
|
var itemOfType = (CinemaFilterFolder)item;
|
||||||
|
|
||||||
var updateType = ItemUpdateType.None;
|
var updateType = ItemUpdateType.None;
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ public class StreamCinemaMetadataService : IMetadataService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var metadataResult = new MetadataResult<StreamCinemaFilterFolder>
|
var metadataResult = new MetadataResult<CinemaFilterFolder>
|
||||||
{
|
{
|
||||||
Item = itemOfType,
|
Item = itemOfType,
|
||||||
//People = LibraryManager.GetPeople(item)
|
//People = LibraryManager.GetPeople(item)
|
||||||
@@ -3,12 +3,12 @@ using MediaBrowser.Controller.Entities;
|
|||||||
using MediaBrowser.Controller.Entities.Movies;
|
using MediaBrowser.Controller.Entities.Movies;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Movie media item from Stream Cinema.
|
/// Movie media item from Cinema.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StreamCinemaMovie : Movie
|
public class CinemaMovie : Movie
|
||||||
{
|
{
|
||||||
public sealed override string GetClientTypeName() => BaseItemKind.Movie.ToString();
|
public sealed override string GetClientTypeName() => BaseItemKind.Movie.ToString();
|
||||||
|
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
using Jellyfin.Data.Enums;
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
sealed class StreamCinemaMoviesFolder : StreamCinemaRootFolder
|
sealed class CinemaMoviesFolder : CinemaRootFolder
|
||||||
{
|
{
|
||||||
private readonly BaseItem _trending;
|
private readonly BaseItem _trending;
|
||||||
private readonly BaseItem _popular;
|
private readonly BaseItem _popular;
|
||||||
private readonly BaseItem _mostWatched;
|
private readonly BaseItem _mostWatched;
|
||||||
private readonly BaseItem _newReleases;
|
private readonly BaseItem _newReleases;
|
||||||
|
|
||||||
public StreamCinemaMoviesFolder()
|
public CinemaMoviesFolder()
|
||||||
{
|
{
|
||||||
this._trending = CreateChildFolder<StreamCinemaTrendingFolder>("Trending");
|
this._trending = CreateChildFolder<CinemaTrendingFolder>("Trending");
|
||||||
this._popular = CreateChildFolder<StreamCinemaPopularFolder>("Popular");
|
this._popular = CreateChildFolder<CinemaPopularFolder>("Popular");
|
||||||
//this._mostWatched = CreateFilterFolder("mostWatched", this, "Most Watched", "watched.png");
|
//this._mostWatched = CreateFilterFolder("mostWatched", this, "Most Watched", "watched.png");
|
||||||
//this._newReleases = CreateFilterFolder("newReleases", this, "New Releases", "new.png");
|
//this._newReleases = CreateFilterFolder("newReleases", this, "New Releases", "new.png");
|
||||||
}
|
}
|
||||||
@@ -6,18 +6,18 @@ using MediaBrowser.Common.Plugins;
|
|||||||
using MediaBrowser.Model.Plugins;
|
using MediaBrowser.Model.Plugins;
|
||||||
using MediaBrowser.Model.Serialization;
|
using MediaBrowser.Model.Serialization;
|
||||||
|
|
||||||
using Jellyfin.Plugin.StreamCinema.Configuration;
|
using Jellyfin.Plugin.Cinema.Configuration;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class Plugin.
|
/// Class Plugin.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StreamCinemaPlugin : BasePlugin<StreamCinemaPluginConfiguration>, IHasWebPages
|
public class CinemaPlugin : BasePlugin<CinemaPluginConfiguration>, IHasWebPages
|
||||||
{
|
{
|
||||||
internal const string StreamCinemaProviderName = "StreamCinema";
|
internal const string CinemaProviderName = "Cinema";
|
||||||
|
|
||||||
public StreamCinemaPlugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
|
public CinemaPlugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
|
||||||
: base(applicationPaths, xmlSerializer)
|
: base(applicationPaths, xmlSerializer)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ public class StreamCinemaPlugin : BasePlugin<StreamCinemaPluginConfiguration>, I
|
|||||||
public override Guid Id => new Guid("253cce3e-aa5f-11ef-bb75-8f5ab4b2eee3");
|
public override Guid Id => new Guid("253cce3e-aa5f-11ef-bb75-8f5ab4b2eee3");
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string Name => "StreamCinema";
|
public override string Name => "Cinema";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string Description => "Videodoplněk obsahující rozsáhlou databázi filmů a seriálů.";
|
public override string Description => "Videodoplněk obsahující rozsáhlou databázi filmů a seriálů.";
|
||||||
@@ -38,13 +38,13 @@ public class StreamCinemaPlugin : BasePlugin<StreamCinemaPluginConfiguration>, I
|
|||||||
{
|
{
|
||||||
new PluginPageInfo
|
new PluginPageInfo
|
||||||
{
|
{
|
||||||
Name = "streamcinema",
|
Name = "cinema",
|
||||||
EmbeddedResourcePath = GetType().Namespace + ".Web.streamcinema.html",
|
EmbeddedResourcePath = GetType().Namespace + ".Web.cinema.html",
|
||||||
},
|
},
|
||||||
new PluginPageInfo
|
new PluginPageInfo
|
||||||
{
|
{
|
||||||
Name = "streamcinemajs",
|
Name = "cinemajs",
|
||||||
EmbeddedResourcePath = GetType().Namespace + ".Web.streamcinema.js"
|
EmbeddedResourcePath = GetType().Namespace + ".Web.cinema.js"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using Jellyfin.Data.Enums;
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
public sealed class StreamCinemaPopularFolder : StreamCinemaSortFolder
|
public sealed class CinemaPopularFolder : CinemaSortFolder
|
||||||
{
|
{
|
||||||
internal override string ImageName => "popular.png";
|
internal override string ImageName => "popular.png";
|
||||||
|
|
||||||
@@ -9,19 +9,19 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Querying;
|
using MediaBrowser.Model.Querying;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stream Cinema root folder that is displayed identically to user-defined libraries.
|
/// Cinema root folder that is displayed identically to user-defined libraries.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class StreamCinemaRootFolder : StreamCinemaFilterFolder, ICollectionFolder
|
public abstract class CinemaRootFolder : CinemaFilterFolder, ICollectionFolder
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the item type for <see cref="ICollectionFolder"/>. Shall be kept in
|
/// Gets the item type for <see cref="ICollectionFolder"/>. Shall be kept in
|
||||||
/// sync with value for <see cref="StreamCinemaFilterFolder.ClientType"/>
|
/// sync with value for <see cref="CinemaFilterFolder.ClientType"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract CollectionType? CollectionType { get; }
|
public abstract CollectionType? CollectionType { get; }
|
||||||
|
|
||||||
@@ -5,21 +5,21 @@ using MediaBrowser.Controller.Plugins;
|
|||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Register StreamCinema services.
|
/// Register Cinema services.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
///
|
///
|
||||||
public class StreamCinemaServiceRegistrator : IPluginServiceRegistrator
|
public class CinemaServiceRegistrator : IPluginServiceRegistrator
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
|
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
|
||||||
{
|
{
|
||||||
serviceCollection.AddSingleton<IImageProvider, StreamCinemaImageProvider>();
|
serviceCollection.AddSingleton<IImageProvider, CinemaImageProvider>();
|
||||||
serviceCollection.AddHostedService<StreamCinemaHost>();
|
serviceCollection.AddHostedService<CinemaHost>();
|
||||||
|
|
||||||
// HACK: Replace IMediaSourceManager as StreamCinemaMediaSourceProvider is not called soon enough while
|
// HACK: Replace IMediaSourceManager as CinemaMediaSourceProvider is not called soon enough while
|
||||||
// entering a media item page.
|
// entering a media item page.
|
||||||
Type tIf = typeof(IMediaSourceManager);
|
Type tIf = typeof(IMediaSourceManager);
|
||||||
int count = serviceCollection.Count;
|
int count = serviceCollection.Count;
|
||||||
@@ -30,12 +30,12 @@ public class StreamCinemaServiceRegistrator : IPluginServiceRegistrator
|
|||||||
{
|
{
|
||||||
Type oldImplType = a.ImplementationType!;
|
Type oldImplType = a.ImplementationType!;
|
||||||
serviceCollection.RemoveAt(i);
|
serviceCollection.RemoveAt(i);
|
||||||
serviceCollection.AddSingleton<IStreamCinemaInnerMediaSourceManager>(new StreamCinemaInnerMediaSourceManager(oldImplType));
|
serviceCollection.AddSingleton<ICinemaInnerMediaSourceManager>(new CinemaInnerMediaSourceManager(oldImplType));
|
||||||
serviceCollection.AddSingleton(oldImplType, oldImplType);
|
serviceCollection.AddSingleton(oldImplType, oldImplType);
|
||||||
// Replace IMediaSourceManager but also need direct access to the StreamCinemaMediaSourceManager if it itself
|
// Replace IMediaSourceManager but also need direct access to the CinemaMediaSourceManager if it itself
|
||||||
// also gets replaced in a longer chain
|
// also gets replaced in a longer chain
|
||||||
serviceCollection.AddSingleton<StreamCinemaMediaSourceManager>();
|
serviceCollection.AddSingleton<CinemaMediaSourceManager>();
|
||||||
serviceCollection.AddSingleton<IMediaSourceManager>(x => x.GetRequiredService<StreamCinemaMediaSourceManager>());
|
serviceCollection.AddSingleton<IMediaSourceManager>(x => x.GetRequiredService<CinemaMediaSourceManager>());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
8
CinemaJellyfin/CinemaSortFolder.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using CinemaLib.API;
|
||||||
|
|
||||||
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
|
public abstract class CinemaSortFolder : CinemaFilterFolder
|
||||||
|
{
|
||||||
|
internal abstract FilterSortBy SortBy { get; }
|
||||||
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using Jellyfin.Data.Enums;
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
public sealed class StreamCinemaTrendingFolder : StreamCinemaSortFolder
|
public sealed class CinemaTrendingFolder : CinemaSortFolder
|
||||||
{
|
{
|
||||||
internal override string ImageName => "trending.png";
|
internal override string ImageName => "trending.png";
|
||||||
|
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
static class StreamCinemaVideoExtensions
|
static class CinemaVideoExtensions
|
||||||
{
|
{
|
||||||
public static IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)>? VideoGetAllItemsForMediaSources<T>(this T @this)
|
public static IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)>? VideoGetAllItemsForMediaSources<T>(this T @this)
|
||||||
where T : Video, new()
|
where T : Video, new()
|
||||||
@@ -16,16 +16,16 @@ static class StreamCinemaVideoExtensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Our media source manager must be present
|
// Our media source manager must be present
|
||||||
StreamCinemaMediaSourceManager? msm;
|
CinemaMediaSourceManager? msm;
|
||||||
if (!StreamCinemaMediaSourceManager.TryGetInstance(out msm))
|
if (!CinemaMediaSourceManager.TryGetInstance(out msm))
|
||||||
return Enumerable.Empty<(BaseItem Item, MediaSourceType MediaSourceType)>();
|
return Enumerable.Empty<(BaseItem Item, MediaSourceType MediaSourceType)>();
|
||||||
|
|
||||||
// Generate item for each StreamCinemaLib.API.Stream. Obtaining the file sub-streams themselves
|
// Generate item for each CinemaLib.API.Stream. Obtaining the file sub-streams themselves
|
||||||
// is intercepted in StreamCinemaMediaSourceManager.GetMediaStreams
|
// is intercepted in CinemaMediaSourceManager.GetMediaStreams
|
||||||
return GetAllItemsForMediaSourcesEnumerate(@this, msm);
|
return GetAllItemsForMediaSourcesEnumerate(@this, msm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)> GetAllItemsForMediaSourcesEnumerate<T>(T @this, StreamCinemaMediaSourceManager msm)
|
private static IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)> GetAllItemsForMediaSourcesEnumerate<T>(T @this, CinemaMediaSourceManager msm)
|
||||||
where T : Video, new()
|
where T : Video, new()
|
||||||
{
|
{
|
||||||
IEnumerable<T>? versions = msm.GetVideoVersions(@this, default).GetAwaiter().GetResult();
|
IEnumerable<T>? versions = msm.GetVideoVersions(@this, default).GetAwaiter().GetResult();
|
||||||
@@ -40,8 +40,8 @@ static class StreamCinemaVideoExtensions
|
|||||||
List<MediaSourceInfo> result = new List<MediaSourceInfo>();
|
List<MediaSourceInfo> result = new List<MediaSourceInfo>();
|
||||||
|
|
||||||
// Our media source manager must be present
|
// Our media source manager must be present
|
||||||
StreamCinemaMediaSourceManager? msm;
|
CinemaMediaSourceManager? msm;
|
||||||
if (!StreamCinemaMediaSourceManager.TryGetInstance(out msm))
|
if (!CinemaMediaSourceManager.TryGetInstance(out msm))
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
var a = msm.GetVersionInfo(@this, default).GetAwaiter().GetResult();
|
var a = msm.GetVersionInfo(@this, default).GetAwaiter().GetResult();
|
||||||
@@ -3,11 +3,11 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
using MediaBrowser.Model.Plugins;
|
using MediaBrowser.Model.Plugins;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema.Configuration;
|
namespace Jellyfin.Plugin.Cinema.Configuration;
|
||||||
|
|
||||||
public class StreamCinemaPluginConfiguration : BasePluginConfiguration
|
public class CinemaPluginConfiguration : BasePluginConfiguration
|
||||||
{
|
{
|
||||||
public StreamCinemaPluginConfiguration()
|
public CinemaPluginConfiguration()
|
||||||
{
|
{
|
||||||
Pin = "0000";
|
Pin = "0000";
|
||||||
WebServiceUrl = "http://localhost:8866";
|
WebServiceUrl = "http://localhost:8866";
|
||||||
5
CinemaJellyfin/ICinemaInnerMediaSourceManager.cs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
|
public interface ICinemaInnerMediaSourceManager {
|
||||||
|
Type InnerType { get; }
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 156 KiB |
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class Art
|
public class Art
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class Cast
|
public class Cast
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class FilterHits
|
public class FilterHits
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class FilterResponse
|
public class FilterResponse
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public enum FilterSortBy
|
public enum FilterSortBy
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class FilterTotalHits
|
public class FilterTotalHits
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class InfoLabelI18n
|
public class InfoLabelI18n
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class InfoLabels
|
public class InfoLabels
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public enum ItemOrder
|
public enum ItemOrder
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public enum ItemType
|
public enum ItemType
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaFormatInfo
|
public class MediaFormatInfo
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaInfo
|
public class MediaInfo
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaLanguageInfo
|
public class MediaLanguageInfo
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaLanguageInfos
|
public class MediaLanguageInfos
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaLanguageItem
|
public class MediaLanguageItem
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaRating
|
public class MediaRating
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaRatings
|
public class MediaRatings
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaSource
|
public class MediaSource
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class MediaStreamInfo
|
public class MediaStreamInfo
|
||||||
{
|
{
|
||||||
@@ -6,7 +6,7 @@ using System.Net.Http.Json;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class Metadata
|
public class Metadata
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class ServicesIds
|
public class ServicesIds
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class ShardsInfo
|
public class ShardsInfo
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class Stream
|
public class Stream
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class StreamAudio
|
public class StreamAudio
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class StreamSubtitle
|
public class StreamSubtitle
|
||||||
{
|
{
|
||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace StreamCinemaLib.API;
|
namespace CinemaLib.API;
|
||||||
|
|
||||||
public class StreamVideo
|
public class StreamVideo
|
||||||
{
|
{
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using StreamCinema.Webshare;
|
using Cinema.Webshare;
|
||||||
|
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace StreamCinema.Webshare;
|
namespace Cinema.Webshare;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs generic binary-to-text encoding.
|
/// Performs generic binary-to-text encoding.
|
||||||
@@ -4,7 +4,7 @@ using System.Security.Cryptography;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
||||||
namespace StreamCinema.Webshare;
|
namespace Cinema.Webshare;
|
||||||
|
|
||||||
public class LinkGenerator
|
public class LinkGenerator
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\StreamCinemaLib\StreamCinemaLib.csproj" />
|
<ProjectReference Include="..\CinemaLib\CinemaLib.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@@ -3,7 +3,7 @@ using System.Buffers;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
||||||
namespace StreamCinemaWeb.Layouts;
|
namespace CinemaWeb.Layouts;
|
||||||
|
|
||||||
public abstract class BasicLayout
|
public abstract class BasicLayout
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
using StreamCinemaWeb.Layouts;
|
using CinemaWeb.Layouts;
|
||||||
|
|
||||||
namespace StreamCinemaWeb.Pages;
|
namespace CinemaWeb.Pages;
|
||||||
|
|
||||||
public class EpisodesPage : BasicLayout
|
public class EpisodesPage : BasicLayout
|
||||||
{
|
{
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using Microsoft.Extensions.Primitives;
|
using Microsoft.Extensions.Primitives;
|
||||||
using StreamCinema.Webshare;
|
using Cinema.Webshare;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
using StreamCinemaWeb.Layouts;
|
using CinemaWeb.Layouts;
|
||||||
using LinkGenerator = StreamCinema.Webshare.LinkGenerator;
|
using LinkGenerator = Cinema.Webshare.LinkGenerator;
|
||||||
|
|
||||||
namespace StreamCinemaWeb.Pages;
|
namespace CinemaWeb.Pages;
|
||||||
|
|
||||||
public class LinkPage : BasicLayout
|
public class LinkPage : BasicLayout
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
using StreamCinemaWeb.Layouts;
|
using CinemaWeb.Layouts;
|
||||||
|
|
||||||
namespace StreamCinemaWeb.Pages;
|
namespace CinemaWeb.Pages;
|
||||||
|
|
||||||
public class MediaPage : BasicLayout
|
public class MediaPage : BasicLayout
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,7 @@ public class MediaPage : BasicLayout
|
|||||||
w.WriteLine("<div>TODO</div>");
|
w.WriteLine("<div>TODO</div>");
|
||||||
w.WriteLine("<h2>Zvolte kvalitu</h2>");
|
w.WriteLine("<h2>Zvolte kvalitu</h2>");
|
||||||
|
|
||||||
StreamCinemaLib.API.Stream[]? res = await Metadata.StreamsAsync(_id, cancel: req.HttpContext.RequestAborted);
|
CinemaLib.API.Stream[]? res = await Metadata.StreamsAsync(_id, cancel: req.HttpContext.RequestAborted);
|
||||||
|
|
||||||
if (res == null || res.Length == 0)
|
if (res == null || res.Length == 0)
|
||||||
{
|
{
|
||||||
@@ -2,11 +2,11 @@ using System;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
||||||
using StreamCinemaWeb.Layouts;
|
using CinemaWeb.Layouts;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace StreamCinemaWeb.Pages;
|
namespace CinemaWeb.Pages;
|
||||||
|
|
||||||
public class SearchPage : BasicLayout
|
public class SearchPage : BasicLayout
|
||||||
{
|
{
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using StreamCinemaLib.API;
|
using CinemaLib.API;
|
||||||
using StreamCinemaWeb.Layouts;
|
using CinemaWeb.Layouts;
|
||||||
|
|
||||||
namespace StreamCinemaWeb.Pages;
|
namespace CinemaWeb.Pages;
|
||||||
|
|
||||||
public class StreamsPage : BasicLayout
|
public class StreamsPage : BasicLayout
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,7 @@ public class StreamsPage : BasicLayout
|
|||||||
w.WriteLine("<h1>" + HttpUtility.HtmlEncode(_title) + "</h1>");
|
w.WriteLine("<h1>" + HttpUtility.HtmlEncode(_title) + "</h1>");
|
||||||
w.WriteLine("<div><b>Zvolte kvalitu</b></div>");
|
w.WriteLine("<div><b>Zvolte kvalitu</b></div>");
|
||||||
|
|
||||||
StreamCinemaLib.API.Stream[]? res = await Metadata.StreamsAsync(_id, cancel: req.HttpContext.RequestAborted);
|
CinemaLib.API.Stream[]? res = await Metadata.StreamsAsync(_id, cancel: req.HttpContext.RequestAborted);
|
||||||
|
|
||||||
if (res == null || res.Length == 0)
|
if (res == null || res.Length == 0)
|
||||||
{
|
{
|
||||||
@@ -36,10 +36,10 @@ public class StreamsPage : BasicLayout
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void RenderStreams(TextWriter w, IEnumerable<StreamCinemaLib.API.Stream> streams, string title)
|
internal static void RenderStreams(TextWriter w, IEnumerable<CinemaLib.API.Stream> streams, string title)
|
||||||
{
|
{
|
||||||
w.WriteLine("<div class=\"media-streams\">");
|
w.WriteLine("<div class=\"media-streams\">");
|
||||||
foreach (StreamCinemaLib.API.Stream i in streams)
|
foreach (CinemaLib.API.Stream i in streams)
|
||||||
{
|
{
|
||||||
// Gather external subtitles
|
// Gather external subtitles
|
||||||
StringBuilder extSubtitles = new StringBuilder();
|
StringBuilder extSubtitles = new StringBuilder();
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using System.Web;
|
using System.Web;
|
||||||
using StreamCinemaWeb.Pages;
|
using CinemaWeb.Pages;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
@@ -2,4 +2,4 @@ FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
|||||||
COPY ./out/ /App/
|
COPY ./out/ /App/
|
||||||
WORKDIR /App
|
WORKDIR /App
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
ENTRYPOINT ["dotnet", "StreamCinemaWeb.dll"]
|
ENTRYPOINT ["dotnet", "CinemaWeb.dll"]
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
namespace Jellyfin.Plugin.StreamCinema;
|
|
||||||
|
|
||||||
public interface IStreamCinemaInnerMediaSourceManager {
|
|
||||||
Type InnerType { get; }
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace Jellyfin.Plugin.StreamCinema;
|
|
||||||
|
|
||||||
class StreamCinemaInnerMediaSourceManager : IStreamCinemaInnerMediaSourceManager
|
|
||||||
{
|
|
||||||
private readonly Type _innerType;
|
|
||||||
|
|
||||||
public StreamCinemaInnerMediaSourceManager(Type innerType) {
|
|
||||||
this._innerType = innerType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Type InnerType => _innerType;
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
using MediaBrowser.Controller.Entities;
|
|
||||||
using StreamCinemaLib.API;
|
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.StreamCinema;
|
|
||||||
|
|
||||||
public abstract class StreamCinemaSortFolder : StreamCinemaFilterFolder
|
|
||||||
{
|
|
||||||
internal abstract FilterSortBy SortBy { get; }
|
|
||||||
}
|
|
||||||