|
|
@ -240,7 +240,7 @@ namespace PlexRequests.Services.Jobs
|
|
|
|
|
|
|
|
|
|
|
|
private List<PlexSearch> CachedLibraries(AuthenticationSettings authSettings, PlexSettings plexSettings, bool setCache)
|
|
|
|
private List<PlexSearch> CachedLibraries(AuthenticationSettings authSettings, PlexSettings plexSettings, bool setCache)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Log.Trace("Obtaining library sections from Plex for the following request");
|
|
|
|
Log.Trace("Obtaining library sections from Plex");
|
|
|
|
|
|
|
|
|
|
|
|
List<PlexSearch> results = new List<PlexSearch>();
|
|
|
|
List<PlexSearch> results = new List<PlexSearch>();
|
|
|
|
|
|
|
|
|
|
|
@ -252,14 +252,19 @@ namespace PlexRequests.Services.Jobs
|
|
|
|
|
|
|
|
|
|
|
|
if (setCache)
|
|
|
|
if (setCache)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
results = GetLibraries(authSettings, plexSettings);
|
|
|
|
Log.Trace("Plex Lib API Call");
|
|
|
|
Cache.Set(CacheKeys.PlexLibaries, results, 10);
|
|
|
|
results = GetLibraries(authSettings, plexSettings);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.Trace("Plex Lib Cache Set Call");
|
|
|
|
|
|
|
|
Cache.Set(CacheKeys.PlexLibaries, results, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.Trace("Plex Lib GetSet Call");
|
|
|
|
results = Cache.GetOrSet(CacheKeys.PlexLibaries, () => {
|
|
|
|
results = Cache.GetOrSet(CacheKeys.PlexLibaries, () => {
|
|
|
|
|
|
|
|
Log.Trace("Plex Lib API Call (inside getset)");
|
|
|
|
return GetLibraries(authSettings, plexSettings);
|
|
|
|
return GetLibraries(authSettings, plexSettings);
|
|
|
|
}, 10);
|
|
|
|
}, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return results;
|
|
|
|
return results;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -282,6 +287,7 @@ namespace PlexRequests.Services.Jobs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.Trace("Returning Plex Libs");
|
|
|
|
return libs;
|
|
|
|
return libs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|