varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling GetUsers for Emby, Retrying {0}",timespan),new[]{
varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling GetSystemInformation for Emby, Retrying {0}",timespan),new[]{
varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling ViewLibrary for Emby, Retrying {0}",timespan),new[]{
varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling GetCollections for Emby, Retrying {0}",timespan),new[]{
varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling GetAll<T>({1}) for Emby, Retrying {0}",timespan,type),new[]{
varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling GetAll<T>({1}) for Emby, Retrying {0}",timespan,type),new[]{
varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling GetRootFolders for Radarr, Retrying {0}",timespan),newTimeSpan[]{
varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling GetProfiles for Sonarr, Retrying {0}",timespan),newTimeSpan[]{
varpolicy=RetryHandler.RetryAndWaitPolicy((exception,timespan)=>Log.Error(exception,"Exception when calling GetRootFolders for Sonarr, Retrying {0}",timespan),newTimeSpan[]{
Log.Error("Provider Id on tv {0} is null",t.Name);
continue;
}
// Check if it exists
varitem=EmbyContent.Custom(connection=>
{
connection.Open();
varmedia=connection.QueryFirstOrDefault<EmbyContent>("select * from EmbyContent where ProviderId = @ProviderId and type = @type",new{ProviderId=tvInfo.ProviderIds.Tvdb,type=1});
connection.Dispose();
returnmedia;
});
if(item==null)
{
EmbyContent.Insert(newEmbyContent
{
ProviderId=tvInfo.ProviderIds.Tvdb,
PremierDate=tvInfo.PremiereDate,
Title=tvInfo.Name,
Type=Store.Models.Plex.EmbyMediaType.Series,
EmbyId=t.Id,
AddedAt=DateTime.UtcNow
});
}
}
//TODO Emby
//var albums = GetPlexAlbums(results);
//foreach (var a in albums)
//{
// if (string.IsNullOrEmpty(a.ProviderId))
// {
// Log.Error("Provider Id on album {0} is null", a.Title);
// continue;
// }
// // Check if it exists
// var item = EmbyContent.Custom(connection =>
// {
// connection.Open();
// var media = connection.QueryFirstOrDefault<PlexContent>("select * from EmbyContent where ProviderId = @ProviderId and type = @type", new { a.ProviderId, type = 2 });
Log.Error("Provider Id on movie {0} is null",movieInfo.Name);
return;
}
// Check if it exists
varitem=EmbyContent.Custom(connection=>
{
connection.Open();
varmedia=connection.QueryFirstOrDefault<EmbyContent>("select * from EmbyContent where ProviderId = @ProviderId and type = @type",new{ProviderId=movieInfo.ProviderIds.Imdb,type=0});
vartvSections=libs.Directories.Where(x=>x.type.Equals(PlexMediaType.Show.ToString(),StringComparison.CurrentCultureIgnoreCase));// We could have more than 1 lib
Log.Debug("Filtered sections for TV");
varmovieSection=libs.Directories.Where(x=>x.type.Equals(PlexMediaType.Movie.ToString(),StringComparison.CurrentCultureIgnoreCase));// We could have more than 1 lib
vartvSections=libs.Directories.Where(x=>x.type.Equals(PlexMediaType.Show.ToString(),StringComparison.CurrentCultureIgnoreCase));// We could have more than 1 lib
Log.Debug("Filtered sections for TV");
varmovieSection=libs.Directories.Where(x=>x.type.Equals(PlexMediaType.Movie.ToString(),StringComparison.CurrentCultureIgnoreCase));// We could have more than 1 lib
<pstyle="font-family: sans-serif; font-size: 20px; font-weight: normal; margin: 0; Margin-bottom: 15px;">Here is a list of Movies and TV Shows that have recently been added to Plex!</p>
<br/>
<br/>
<pstyle="font-family: sans-serif; font-size: 20px; font-weight: normal; margin: 0; Margin-bottom: 15px;">Here is a list of Movies and TV Shows that have recently been added!</p>