dll integration
This commit is contained in:
@@ -0,0 +1,246 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Security;
|
||||
using MediaBrowser.Model.Cryptography;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
namespace Emby.Security;
|
||||
|
||||
public class PluginSecurityManager : IServerEntryPoint, IDisposable
|
||||
{
|
||||
private const string MBValidateUrl = "https://mb3admin.com/admin/service/registration/validate";
|
||||
|
||||
private readonly IHttpClient _httpClient;
|
||||
|
||||
private readonly IJsonSerializer _jsonSerializer;
|
||||
|
||||
private readonly IServerApplicationHost _appHost;
|
||||
|
||||
private readonly ILogger _logger;
|
||||
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
private readonly ICryptoProvider _cryptographyProvider;
|
||||
|
||||
private readonly ISecurityManager _securityManager;
|
||||
|
||||
private readonly IEncryptionManager _encryption;
|
||||
|
||||
public static PluginSecurityManager Current;
|
||||
|
||||
private readonly Dictionary<string, RegRecord> _regRecordCache = new Dictionary<string, RegRecord>();
|
||||
|
||||
private SemaphoreSlim _regLock = new SemaphoreSlim(1, 1);
|
||||
|
||||
public PluginSecurityManager(IServerApplicationHost appHost, IHttpClient httpClient, IJsonSerializer jsonSerializer, IApplicationPaths appPaths, ILogManager logManager, IFileSystem fileSystem, ICryptoProvider cryptographyProvider, ISecurityManager securityManager, IEncryptionManager encryption)
|
||||
{
|
||||
if (httpClient == null)
|
||||
{
|
||||
throw new ArgumentNullException("httpClient");
|
||||
}
|
||||
_appHost = appHost;
|
||||
_httpClient = httpClient;
|
||||
_jsonSerializer = jsonSerializer;
|
||||
_appPaths = appPaths;
|
||||
_fileSystem = fileSystem;
|
||||
_cryptographyProvider = cryptographyProvider;
|
||||
_securityManager = securityManager;
|
||||
_encryption = encryption;
|
||||
_logger = logManager.GetLogger("Plugin");
|
||||
Current = this;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
private string GetCacheFilePath(string feature)
|
||||
{
|
||||
string text = GetType().FullName + GetCacheKey(feature);
|
||||
text = BaseExtensions.GetMD5(text).ToString("N");
|
||||
return Path.Combine(_appPaths.PluginConfigurationsPath, text);
|
||||
}
|
||||
|
||||
private RegRecord GetCachedRegRecord(string feature)
|
||||
{
|
||||
lock (_regRecordCache)
|
||||
{
|
||||
if (_regRecordCache.TryGetValue(GetCacheKey(feature), out var value))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
string cacheFilePath = GetCacheFilePath(feature);
|
||||
try
|
||||
{
|
||||
string text = _encryption.DecryptString(_fileSystem.ReadAllText(cacheFilePath));
|
||||
RegRecord value = _jsonSerializer.DeserializeFromString<RegRecord>(text);
|
||||
if (value != null)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private string GetCacheKey(string feature)
|
||||
{
|
||||
string text = _securityManager.SupporterKey;
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
text = "none";
|
||||
}
|
||||
return text + "-" + feature;
|
||||
}
|
||||
|
||||
private void DeleteCachedRecord(string feature)
|
||||
{
|
||||
lock (_regRecordCache)
|
||||
{
|
||||
_regRecordCache.Remove(GetCacheKey(feature));
|
||||
}
|
||||
try
|
||||
{
|
||||
_fileSystem.DeleteFile(GetCacheFilePath(feature));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveCachedRecord(string feature, RegRecord record)
|
||||
{
|
||||
lock (_regRecordCache)
|
||||
{
|
||||
_regRecordCache[GetCacheKey(feature)] = record;
|
||||
}
|
||||
string cacheFilePath = GetCacheFilePath(feature);
|
||||
string text = _jsonSerializer.SerializeToString((object)record);
|
||||
string text2 = _encryption.EncryptString(text);
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFilePath));
|
||||
_fileSystem.WriteAllText(cacheFilePath, text2);
|
||||
}
|
||||
|
||||
public async Task<RegRecord> GetRegistrationStatus(string feature, CancellationToken cancellationToken)
|
||||
{
|
||||
await _regLock.WaitAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
|
||||
try
|
||||
{
|
||||
return await GetRegistrationStatusInternal(feature, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_regLock.Release();
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckRegistrationWithServer(DateTime lastChecked, bool registered)
|
||||
{
|
||||
if (registered || string.IsNullOrWhiteSpace(_securityManager.SupporterKey))
|
||||
{
|
||||
if (DateTime.UtcNow.AddDays(-1.0) > lastChecked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (DateTime.UtcNow.AddHours(-1.0) > lastChecked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private async Task<RegRecord> GetRegistrationStatusInternal(string feature, CancellationToken cancellationToken)
|
||||
{
|
||||
RegRecord regInfo = GetCachedRegRecord(feature);
|
||||
DateTime lastChecked = regInfo?.lastChecked ?? DateTime.MinValue;
|
||||
DateTime expDate = regInfo?.expDate ?? DateTime.MinValue;
|
||||
bool registered = regInfo?.registered ?? false;
|
||||
string supporterKey = _securityManager.SupporterKey;
|
||||
if (CheckRegistrationWithServer(lastChecked, registered))
|
||||
{
|
||||
Dictionary<string, string> postData = new Dictionary<string, string>
|
||||
{
|
||||
{ "feature", feature },
|
||||
{ "key", supporterKey },
|
||||
{
|
||||
"mac",
|
||||
((IApplicationHost)_appHost).SystemId
|
||||
},
|
||||
{
|
||||
"systemid",
|
||||
((IApplicationHost)_appHost).SystemId
|
||||
},
|
||||
{
|
||||
"platform",
|
||||
((IApplicationHost)_appHost).OperatingSystemDisplayName
|
||||
}
|
||||
};
|
||||
try
|
||||
{
|
||||
HttpRequestOptions val = new HttpRequestOptions
|
||||
{
|
||||
Url = "https://mb3admin.com/admin/service/registration/validate",
|
||||
EnableHttpCompression = false,
|
||||
BufferContent = false,
|
||||
CancellationToken = cancellationToken
|
||||
};
|
||||
val.SetPostData((IDictionary<string, string>)postData);
|
||||
HttpResponseInfo val2 = await _httpClient.SendAsync(val, "POST").ConfigureAwait(continueOnCapturedContext: false);
|
||||
try
|
||||
{
|
||||
using Stream stream = val2.Content;
|
||||
regInfo = _jsonSerializer.DeserializeFromStream<RegRecord>(stream);
|
||||
regInfo.lastChecked = DateTime.UtcNow;
|
||||
SaveCachedRecord(feature, regInfo);
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val2)?.Dispose();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error checking registration status of {0}", ex, new object[1] { feature });
|
||||
int num = 14;
|
||||
DateTime dateTime = new DateTime[2]
|
||||
{
|
||||
expDate,
|
||||
lastChecked.AddDays(num)
|
||||
}.Min();
|
||||
if (dateTime > DateTime.UtcNow.AddDays(num))
|
||||
{
|
||||
dateTime = DateTime.MinValue;
|
||||
}
|
||||
regInfo = new RegRecord
|
||||
{
|
||||
registered = (regInfo != null && regInfo.registered && dateTime >= DateTime.UtcNow && expDate >= DateTime.UtcNow),
|
||||
expDate = expDate
|
||||
};
|
||||
}
|
||||
}
|
||||
return regInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Emby.Security;
|
||||
|
||||
public class RegRecord
|
||||
{
|
||||
public string featId { get; set; }
|
||||
|
||||
public bool registered { get; set; }
|
||||
|
||||
public DateTime expDate { get; set; }
|
||||
|
||||
public string key { get; set; }
|
||||
|
||||
public DateTime lastChecked { get; set; }
|
||||
|
||||
public bool isTrial
|
||||
{
|
||||
get
|
||||
{
|
||||
if (expDate > DateTime.UtcNow)
|
||||
{
|
||||
return !registered;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool isValid
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!isTrial)
|
||||
{
|
||||
return registered;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Emby.Security;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Controller.Notifications;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Plugins.TimeLordMovies.ScheduledTasks;
|
||||
|
||||
public class TLMoviesScheduledTask : IScheduledTask
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
private readonly IMediaEncoder _mediaEncoder;
|
||||
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
|
||||
private readonly ILibraryMonitor _libraryMonitor;
|
||||
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
private readonly INotificationManager _notificationManager;
|
||||
|
||||
private readonly IItemRepository _itemRepo;
|
||||
|
||||
public string Category => "Time Lord";
|
||||
|
||||
public string Key => "TimeLordMovies";
|
||||
|
||||
public string Description => "Sets the Movie Date Added to the original premier date (Movies)";
|
||||
|
||||
public string Name => "Change Movie date added to original Premier date";
|
||||
|
||||
public TLMoviesScheduledTask(ILibraryManager libraryManager, ILogger logger, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IApplicationPaths appPaths, ILibraryMonitor libraryMonitor, ISecurityManager securityManager, IUserManager userManager, INotificationManager notificationManager, IItemRepository itemRepo)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
_logger = logger;
|
||||
_userManager = userManager;
|
||||
_mediaEncoder = mediaEncoder;
|
||||
_fileSystem = fileSystem;
|
||||
_appPaths = appPaths;
|
||||
_libraryMonitor = libraryMonitor;
|
||||
_notificationManager = notificationManager;
|
||||
_itemRepo = itemRepo;
|
||||
}
|
||||
|
||||
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
{
|
||||
RegRecord registration = await PluginSecurityManager.Current.GetRegistrationStatus("TimeLordMovies", cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
|
||||
Plugin.Instance.Registration = registration;
|
||||
_logger.Info("TimeLordMovies Registration Status - Registered: {0} In trial: {2} Expiration Date: {1} Is Valid: {3}", new object[4]
|
||||
{
|
||||
Plugin.Instance.Registration.registered,
|
||||
Plugin.Instance.Registration.expDate,
|
||||
Plugin.Instance.Registration.isTrial,
|
||||
Plugin.Instance.Registration.isValid
|
||||
});
|
||||
if (Plugin.Instance.Registration.isTrial)
|
||||
{
|
||||
_logger.Info(((BasePlugin)Plugin.Instance).Name + " You are Using the Trial Version, Please Consider purchasing to continue using the plugin after the trial period", new object[0]);
|
||||
}
|
||||
if (!Plugin.Instance.Registration.isValid)
|
||||
{
|
||||
_logger.Info(((BasePlugin)Plugin.Instance).Name + " Trial Expired, Please register to continue using the plugin", new object[0]);
|
||||
return;
|
||||
}
|
||||
_logger.Info("TimeLord.Movies :: Start :", (object[])null);
|
||||
try
|
||||
{
|
||||
_logger.Info("TimeLord.Movies :: Rework Movie Dates :: Start", (object[])null);
|
||||
AggregateFolder rootFolder = _libraryManager.RootFolder;
|
||||
InternalItemsQuery val = new InternalItemsQuery();
|
||||
val.IncludeItemTypes = new string[1] { typeof(Movie).Name };
|
||||
val.Recursive = true;
|
||||
List<BaseItem> list = ((Folder)rootFolder).GetItemList(val).Where(delegate(BaseItem i)
|
||||
{
|
||||
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
|
||||
if ((int)i.LocationType == 0)
|
||||
{
|
||||
DateTimeOffset dateCreated = i.DateCreated;
|
||||
DateTimeOffset? premiereDate = i.PremiereDate;
|
||||
if (premiereDate.HasValue && dateCreated > premiereDate.GetValueOrDefault() && i.PremiereDate.HasValue)
|
||||
{
|
||||
return !i.IsLocked;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).ToList();
|
||||
int num = 0;
|
||||
foreach (Movie item in list)
|
||||
{
|
||||
Movie val2 = item;
|
||||
try
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
((BaseItem)val2).DateCreated = ((BaseItem)val2).PremiereDate.Value;
|
||||
try
|
||||
{
|
||||
((BaseItem)val2).UpdateToRepository((ItemUpdateType)16);
|
||||
_logger.Info("TimeLord.Movies:: Updated :: " + ((BaseItem)val2).Name, (object[])null);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.Info("TimeLord.Movies :: Updated :: " + ((BaseItem)val2).Name, (object[])null);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
_logger.Info("TimeLord.Movies :: Canceled", (object[])null);
|
||||
break;
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
_logger.ErrorException("TimeLord.Movies :: Error messing about with {0}", ex2, new object[1] { ((BaseItem)val2).Name });
|
||||
}
|
||||
num++;
|
||||
double num2 = num;
|
||||
num2 /= (double)list.Count();
|
||||
num2 *= 100.0;
|
||||
progress.Report(num2);
|
||||
}
|
||||
}
|
||||
catch (Exception ex3)
|
||||
{
|
||||
_logger.ErrorException("TimeLord.Movies :: Error {0}", ex3, Array.Empty<object>());
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||
{
|
||||
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_003a: Expected O, but got Unknown
|
||||
return (IEnumerable<TaskTriggerInfo>)(object)new TaskTriggerInfo[1]
|
||||
{
|
||||
new TaskTriggerInfo
|
||||
{
|
||||
Type = "DailyTrigger",
|
||||
TimeOfDayTicks = TimeSpan.FromHours(5.0).Ticks
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Emby.Security;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Controller.Notifications;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Plugins.TimeLordMovies.ScheduledTasks;
|
||||
|
||||
public class TLTrailersScheduledTask : IScheduledTask
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
private readonly IMediaEncoder _mediaEncoder;
|
||||
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
|
||||
private readonly ILibraryMonitor _libraryMonitor;
|
||||
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
private readonly INotificationManager _notificationManager;
|
||||
|
||||
private readonly IItemRepository _itemRepo;
|
||||
|
||||
public string Category => "Time Lord";
|
||||
|
||||
public string Key => "TimeLordMovies";
|
||||
|
||||
public string Description => "Sets the Trailer Date Added to the original premier date (Trailer)";
|
||||
|
||||
public string Name => "Change Trailer date added to original Premier date";
|
||||
|
||||
public TLTrailersScheduledTask(ILibraryManager libraryManager, ILogger logger, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IApplicationPaths appPaths, ILibraryMonitor libraryMonitor, ISecurityManager securityManager, IUserManager userManager, INotificationManager notificationManager, IItemRepository itemRepo)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
_logger = logger;
|
||||
_userManager = userManager;
|
||||
_mediaEncoder = mediaEncoder;
|
||||
_fileSystem = fileSystem;
|
||||
_appPaths = appPaths;
|
||||
_libraryMonitor = libraryMonitor;
|
||||
_notificationManager = notificationManager;
|
||||
_itemRepo = itemRepo;
|
||||
}
|
||||
|
||||
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
{
|
||||
RegRecord registration = await PluginSecurityManager.Current.GetRegistrationStatus("TimeLordMovies", cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
|
||||
Plugin.Instance.Registration = registration;
|
||||
_logger.Info("TimeLordMovies Registration Status - Registered: {0} In trial: {2} Expiration Date: {1} Is Valid: {3}", new object[4]
|
||||
{
|
||||
Plugin.Instance.Registration.registered,
|
||||
Plugin.Instance.Registration.expDate,
|
||||
Plugin.Instance.Registration.isTrial,
|
||||
Plugin.Instance.Registration.isValid
|
||||
});
|
||||
if (Plugin.Instance.Registration.isTrial)
|
||||
{
|
||||
_logger.Info(((BasePlugin)Plugin.Instance).Name + " You are Using the Trial Version, Please Consider purchasing to continue using the plugin after the trial period", new object[0]);
|
||||
}
|
||||
if (!Plugin.Instance.Registration.isValid)
|
||||
{
|
||||
_logger.Info(((BasePlugin)Plugin.Instance).Name + " Trial Expired, Please register to continue using the plugin", new object[0]);
|
||||
return;
|
||||
}
|
||||
_logger.Info("TimeLordMovies :: Start :", (object[])null);
|
||||
try
|
||||
{
|
||||
_logger.Info("TimeLord :: Rework Trailer Dates :: Start", (object[])null);
|
||||
AggregateFolder rootFolder = _libraryManager.RootFolder;
|
||||
InternalItemsQuery val = new InternalItemsQuery();
|
||||
val.IncludeItemTypes = new string[1] { typeof(Trailer).Name };
|
||||
val.Recursive = true;
|
||||
List<BaseItem> list = ((Folder)rootFolder).GetItemList(val).Where(delegate(BaseItem i)
|
||||
{
|
||||
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
|
||||
if ((int)i.LocationType != 0)
|
||||
{
|
||||
DateTimeOffset dateCreated = i.DateCreated;
|
||||
DateTimeOffset? premiereDate = i.PremiereDate;
|
||||
if (premiereDate.HasValue && dateCreated > premiereDate.GetValueOrDefault() && i.PremiereDate.HasValue)
|
||||
{
|
||||
return !i.IsLocked;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).ToList();
|
||||
int num = 0;
|
||||
foreach (Trailer item in list)
|
||||
{
|
||||
Trailer val2 = item;
|
||||
try
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
((BaseItem)val2).DateCreated = ((BaseItem)val2).PremiereDate.Value;
|
||||
try
|
||||
{
|
||||
((BaseItem)val2).UpdateToRepository((ItemUpdateType)16);
|
||||
_logger.Info("TimeLord.Trailers :: Updated :: " + ((BaseItem)val2).Name, (object[])null);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.Info("TimeLord.Trailers :: Updated :: " + ((BaseItem)val2).Name, (object[])null);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
_logger.Info("TimeLord.Trailers :: Canceled", (object[])null);
|
||||
break;
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
_logger.ErrorException("TimeLord.Trailers :: Error messing about with {0}", ex2, new object[1] { ((BaseItem)val2).Name });
|
||||
}
|
||||
num++;
|
||||
double num2 = num;
|
||||
num2 /= (double)list.Count();
|
||||
num2 *= 100.0;
|
||||
progress.Report(num2);
|
||||
}
|
||||
}
|
||||
catch (Exception ex3)
|
||||
{
|
||||
_logger.ErrorException("TimeLord.Trailers :: Error {0}", ex3, Array.Empty<object>());
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||
{
|
||||
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_003a: Expected O, but got Unknown
|
||||
return (IEnumerable<TaskTriggerInfo>)(object)new TaskTriggerInfo[1]
|
||||
{
|
||||
new TaskTriggerInfo
|
||||
{
|
||||
Type = "DailyTrigger",
|
||||
TimeOfDayTicks = TimeSpan.FromHours(5.0).Ticks
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<AssemblyName>MediaBrowser.Plugins.TimeLordMovies</AssemblyName>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RootNamespace />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="MediaBrowser.Plugins.TimeLordMovies.thumb.png" />
|
||||
<EmbeddedResource Include="MediaBrowser.Plugins.TimeLordMovies.thumb.png" LogicalName="MediaBrowser.Plugins.TimeLordMovies.thumb.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MediaBrowser.Controller" />
|
||||
<Reference Include="MediaBrowser.Common" />
|
||||
<Reference Include="MediaBrowser.Model" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Emby.Security;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
|
||||
namespace MediaBrowser.Plugins.TimeLordMovies;
|
||||
|
||||
public class Plugin : BasePlugin, IHasThumbImage
|
||||
{
|
||||
private Guid _id = new Guid("71a3ff1b-c589-4a39-b948-12f08b7715ee");
|
||||
|
||||
public RegRecord Registration;
|
||||
|
||||
public override string Name => "TimeLordMovies";
|
||||
|
||||
public override string Description => "TimeLord Movies allows you to set the date added for Movies to the original Theatrical release date set in the metadata for items in your collection. This is usefull when adding old Movies to your collection, as it prevents theses 'New' Movies from dominating your recently added list. Take control of time with TimeLord Movies.";
|
||||
|
||||
public override Guid Id => _id;
|
||||
|
||||
public ImageFormat ThumbImageFormat => (ImageFormat)3;
|
||||
|
||||
public static Plugin Instance { get; private set; }
|
||||
|
||||
public Stream GetThumbImage()
|
||||
{
|
||||
Type type = ((object)this).GetType();
|
||||
return type.Assembly.GetManifestResourceStream(type.Namespace + ".thumb.png");
|
||||
}
|
||||
|
||||
public Plugin()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("71a3ff1b-c589-4a39-b948-12f08b7715ee")]
|
||||
[assembly: AssemblyCompany("ScoobydooProject.com")]
|
||||
[assembly: AssemblyConfiguration("Release")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 ScoobydooProject.com")]
|
||||
[assembly: AssemblyDescription("Wayback Machine for TV Movies")]
|
||||
[assembly: AssemblyFileVersion("19.08.03.1105")]
|
||||
[assembly: AssemblyInformationalVersion("3.2.32.14")]
|
||||
[assembly: AssemblyProduct("MediaBrowser.Plugins.TimeLordMovies")]
|
||||
[assembly: AssemblyTitle("MediaBrowser.Plugins.TimeLordMovies")]
|
||||
[assembly: AssemblyVersion("19.8.3.1105")]
|
||||
Reference in New Issue
Block a user