mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Hide the auto update btn #236
Fixed where we were not populating the emby episodes #435 Fixed #1048 issue 1,2,4
This commit is contained in:
parent
f60eec4d4a
commit
16b6b6acea
8 changed files with 1757 additions and 1746 deletions
|
@ -49,7 +49,7 @@ namespace Ombi.Api.Models.Emby
|
|||
public object[] Taglines { get; set; }
|
||||
public object[] Genres { get; set; }
|
||||
public string[] SeriesGenres { get; set; }
|
||||
public int CommunityRating { get; set; }
|
||||
public float CommunityRating { get; set; }
|
||||
public int VoteCount { get; set; }
|
||||
public long RunTimeTicks { get; set; }
|
||||
public string PlayAccess { get; set; }
|
||||
|
|
|
@ -286,7 +286,9 @@ namespace Ombi.Services.Jobs
|
|||
var ep = await EpisodeRepo.CustomAsync(async connection =>
|
||||
{
|
||||
connection.Open();
|
||||
var result = await connection.QueryAsync<EmbyEpisodes>("select * from EmbyEpisodes where ProviderId = @ProviderId", new { ProviderId = theTvDbId });
|
||||
var result = await connection.QueryAsync<EmbyEpisodes>(@"select ee.* from EmbyEpisodes ee inner join EmbyContent ec
|
||||
on ee.ParentId = ec.EmbyId
|
||||
where ec.ProviderId = @ProviderId", new { ProviderId = theTvDbId });
|
||||
|
||||
return result;
|
||||
});
|
||||
|
|
|
@ -74,6 +74,10 @@ namespace Ombi.Services.Jobs
|
|||
{
|
||||
var epInfo = EmbyApi.GetInformation(ep.Id, EmbyMediaType.Episode, settings.ApiKey,
|
||||
settings.AdministratorId, settings.FullUri);
|
||||
if (epInfo.EpisodeInformation?.ProviderIds?.Tvdb == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
model.Add(new EmbyEpisodes
|
||||
{
|
||||
EmbyId = ep.Id,
|
||||
|
@ -82,7 +86,7 @@ namespace Ombi.Services.Jobs
|
|||
EpisodeTitle = ep.Name,
|
||||
ParentId = ep.SeriesId,
|
||||
ShowTitle = ep.SeriesName,
|
||||
ProviderId = epInfo.EpisodeInformation.ProviderIds.Tmdb
|
||||
ProviderId = epInfo.EpisodeInformation.ProviderIds.Tvdb
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -108,15 +112,6 @@ namespace Ombi.Services.Jobs
|
|||
return;
|
||||
}
|
||||
|
||||
var jobs = Job.GetJobs();
|
||||
var job = jobs.FirstOrDefault(x => x.Name.Equals(JobNames.EmbyEpisodeCacher, StringComparison.CurrentCultureIgnoreCase));
|
||||
if (job != null)
|
||||
{
|
||||
if (job.LastRun > DateTime.Now.AddHours(-11)) // If it's been run in the last 11 hours
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
Job.SetRunning(true, JobNames.EmbyEpisodeCacher);
|
||||
CacheEpisodes(s);
|
||||
}
|
||||
|
@ -141,15 +136,6 @@ namespace Ombi.Services.Jobs
|
|||
return;
|
||||
}
|
||||
|
||||
var jobs = Job.GetJobs();
|
||||
var job = jobs.FirstOrDefault(x => x.Name.Equals(JobNames.EmbyEpisodeCacher, StringComparison.CurrentCultureIgnoreCase));
|
||||
if (job != null)
|
||||
{
|
||||
if (job.LastRun > DateTime.Now.AddHours(-11)) // If it's been run in the last 11 hours
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
Job.SetRunning(true, JobNames.EmbyEpisodeCacher);
|
||||
CacheEpisodes(s);
|
||||
}
|
||||
|
|
|
@ -304,8 +304,8 @@ namespace Ombi.UI.Jobs
|
|||
var embyEpisode =
|
||||
TriggerBuilder.Create()
|
||||
.WithIdentity("EmbyEpisodeCacher", "Emby")
|
||||
.StartNow()
|
||||
//.StartAt(DateBuilder.FutureDate(10, IntervalUnit.Minute))
|
||||
.StartAt(DateBuilder.FutureDate(10, IntervalUnit.Minute))
|
||||
.WithSimpleSchedule(x => x.WithIntervalInHours(s.EmbyEpisodeCacher).RepeatForever())
|
||||
.Build();
|
||||
|
||||
|
|
|
@ -441,11 +441,15 @@ namespace Ombi.UI.Modules.Admin
|
|||
private async Task<Response> SavePlex()
|
||||
{
|
||||
var plexSettings = this.Bind<PlexSettings>();
|
||||
|
||||
if (plexSettings.Enable)
|
||||
{
|
||||
var valid = this.Validate(plexSettings);
|
||||
if (!valid.IsValid)
|
||||
{
|
||||
return Response.AsJson(valid.SendJsonError());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (plexSettings.Enable)
|
||||
|
@ -462,7 +466,7 @@ namespace Ombi.UI.Modules.Admin
|
|||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(plexSettings.MachineIdentifier))
|
||||
if (string.IsNullOrEmpty(plexSettings.MachineIdentifier) && plexSettings.Enable)
|
||||
{
|
||||
//Lookup identifier
|
||||
var server = PlexApi.GetServer(plexSettings.PlexAuthToken);
|
||||
|
@ -1166,7 +1170,13 @@ namespace Ombi.UI.Modules.Admin
|
|||
FaultQueueHandler = s.FaultQueueHandler,
|
||||
PlexEpisodeCacher = s.PlexEpisodeCacher,
|
||||
PlexUserChecker = s.PlexUserChecker,
|
||||
UserRequestLimitResetter = s.UserRequestLimitResetter
|
||||
UserRequestLimitResetter = s.UserRequestLimitResetter,
|
||||
EmbyAvailabilityChecker = s.EmbyAvailabilityChecker,
|
||||
EmbyContentCacher = s.EmbyContentCacher,
|
||||
EmbyEpisodeCacher = s.EmbyEpisodeCacher,
|
||||
EmbyUserChecker = s.EmbyUserChecker,
|
||||
RadarrCacher = s.RadarrCacher,
|
||||
WatcherCacher = s.WatcherCacher
|
||||
};
|
||||
return View["SchedulerSettings", model];
|
||||
}
|
||||
|
|
|
@ -577,6 +577,7 @@ namespace Ombi.UI.Modules
|
|||
Analytics.TrackEventAsync(Category.Search, Action.TvShow, searchTerm, Username,
|
||||
CookieHelper.GetAnalyticClientId(Cookies));
|
||||
var plexSettings = await PlexService.GetSettingsAsync();
|
||||
var embySettings = await EmbySettings.GetSettingsAsync();
|
||||
var prSettings = await PrService.GetSettingsAsync();
|
||||
var providerId = string.Empty;
|
||||
|
||||
|
@ -600,6 +601,8 @@ namespace Ombi.UI.Modules
|
|||
var sickRageCache = SickRageCacher.QueuedIds(); // consider just merging sonarr/sickrage arrays
|
||||
var content = PlexContentRepository.GetAll();
|
||||
var plexTvShows = PlexChecker.GetPlexTvShows(content);
|
||||
var embyContent = EmbyContentRepository.GetAll();
|
||||
var embyCached = EmbyChecker.GetEmbyTvShows(embyContent);
|
||||
|
||||
var viewTv = new List<SearchTvShowViewModel>();
|
||||
foreach (var t in apiTv)
|
||||
|
@ -633,12 +636,18 @@ namespace Ombi.UI.Modules
|
|||
EnableTvRequestsForOnlySeries = (prSettings.DisableTvRequestsByEpisode && prSettings.DisableTvRequestsBySeason)
|
||||
};
|
||||
|
||||
|
||||
if (plexSettings.AdvancedSearch)
|
||||
{
|
||||
providerId = viewT.Id.ToString();
|
||||
}
|
||||
|
||||
if (embySettings.Enable)
|
||||
{
|
||||
var embyShow = EmbyChecker.GetTvShow(embyCached.ToArray(), t.show.name, t.show.premiered?.Substring(0, 4), providerId);
|
||||
if (embyShow != null)
|
||||
{
|
||||
viewT.Available = true;
|
||||
}
|
||||
}
|
||||
if (plexSettings.Enable)
|
||||
{
|
||||
var plexShow = PlexChecker.GetTvShow(plexTvShows.ToArray(), t.show.name, t.show.premiered?.Substring(0, 4),
|
||||
providerId);
|
||||
if (plexShow != null)
|
||||
|
@ -646,7 +655,9 @@ namespace Ombi.UI.Modules
|
|||
viewT.Available = true;
|
||||
viewT.PlexUrl = plexShow.Url;
|
||||
}
|
||||
else if (t.show?.externals?.thetvdb != null)
|
||||
}
|
||||
|
||||
if (t.show?.externals?.thetvdb != null && !viewT.Available)
|
||||
{
|
||||
var tvdbid = (int)t.show.externals.thetvdb;
|
||||
if (dbTv.ContainsKey(tvdbid))
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@Html.Checkbox(Model.EnableEpisodeSearching, "EnableEpisodeSearching", "Enable Episode Searching")
|
||||
|
||||
<div class="form-group">
|
||||
<label for="SubDir" class="control-label">Emby Base Url</label>
|
||||
<div>
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
{
|
||||
<label class="control-label"><a href="@Model.Status.UpdateUri" target="_blank"><i class="fa fa-check"></i></a></label>
|
||||
<br />
|
||||
<input id="args" class="form-control form-control-custom " placeholder="optional launch arguments e.g. /etc/mono /opt/PlexRequests.exe">
|
||||
@*<input id="args" class="form-control form-control-custom " placeholder="optional launch arguments e.g. /etc/mono /opt/PlexRequests.exe">*@
|
||||
<br/>
|
||||
<button id="autoUpdate" class="btn btn-success-outline">Automatic Update (beta) <i class="fa fa-download"></i></button>
|
||||
@*<button id="autoUpdate" class="btn btn-success-outline">Automatic Update (beta) <i class="fa fa-download"></i></button>*@
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue