mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
merge
This commit is contained in:
commit
fb19ffe9e7
6 changed files with 62 additions and 7 deletions
11
PlexRequests.UI/Content/base.css
vendored
11
PlexRequests.UI/Content/base.css
vendored
|
@ -341,3 +341,14 @@ label {
|
|||
-webkit-box-shadow: 3px 3px 5px 6px #191919;
|
||||
box-shadow: 3px 3px 5px 6px #191919; }
|
||||
|
||||
.img-circle {
|
||||
border-radius: 50%; }
|
||||
|
||||
.user-management-menu {
|
||||
border-style: ridge;
|
||||
height: 100%;
|
||||
left: 60%;
|
||||
position: absolute;
|
||||
width: 40%;
|
||||
top: 7%; }
|
||||
|
||||
|
|
2
PlexRequests.UI/Content/base.min.css
vendored
2
PlexRequests.UI/Content/base.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -430,3 +430,15 @@ $border-radius: 10px;
|
|||
-webkit-box-shadow: 3px 3px 5px 6px #191919;
|
||||
box-shadow: 3px 3px 5px 6px #191919;
|
||||
}
|
||||
.img-circle {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-management-menu {
|
||||
border-style: ridge;
|
||||
height: 100%;
|
||||
left: 60%;
|
||||
position: absolute;
|
||||
width: 40%;
|
||||
top: 7%;
|
||||
}
|
|
@ -106,7 +106,7 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
|
||||
// We now have the series in Sonarr, update it to request the episodes.
|
||||
await RequestEpisodesWithExistingSeries(model, series, sonarrSettings);
|
||||
await RequestAllEpisodesInASeasonWithExistingSeries(model, series, sonarrSettings);
|
||||
|
||||
return addResult;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
// Update the series in sonarr with the new monitored status
|
||||
SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
await RequestAllEpisodesWithExistingSeries(model, series, sonarrSettings);
|
||||
await RequestAllEpisodesInASeasonWithExistingSeries(model, series, sonarrSettings);
|
||||
return new SonarrAddSeries { title = series.title }; // We have updated it
|
||||
}
|
||||
|
||||
|
@ -220,6 +220,38 @@ namespace PlexRequests.UI.Helpers
|
|||
SonarrApi.SearchForEpisodes(internalEpisodeIds.ToArray(), sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
}
|
||||
|
||||
|
||||
internal async Task RequestAllEpisodesInASeasonWithExistingSeries(RequestedModel model, Series selectedSeries, SonarrSettings sonarrSettings)
|
||||
{
|
||||
// Show Exists
|
||||
// Look up all episodes
|
||||
var ep = SonarrApi.GetEpisodes(selectedSeries.id.ToString(), sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
var episodes = ep?.ToList() ?? new List<SonarrEpisodes>();
|
||||
|
||||
var internalEpisodeIds = new List<int>();
|
||||
var tasks = new List<Task>();
|
||||
foreach (var r in episodes)
|
||||
{
|
||||
if (r.hasFile || !model.SeasonList.Contains(r.seasonNumber)) // If it already has the file, there is no point in updating it
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Lookup the individual episode details
|
||||
var episodeInfo = SonarrApi.GetEpisode(r.id.ToString(), sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
// If the season is not in thr
|
||||
|
||||
episodeInfo.monitored = true; // Set the episode to monitored
|
||||
|
||||
tasks.Add(Task.Run(() => SonarrApi.UpdateEpisode(episodeInfo, sonarrSettings.ApiKey,
|
||||
sonarrSettings.FullUri)));
|
||||
internalEpisodeIds.Add(r.id);
|
||||
}
|
||||
|
||||
await Task.WhenAll(tasks.ToArray());
|
||||
|
||||
SonarrApi.SearchForEpisodes(internalEpisodeIds.ToArray(), sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
}
|
||||
private async Task<Series> GetSonarrSeries(SonarrSettings sonarrSettings, int showId)
|
||||
{
|
||||
var task = await Task.Run(() => SonarrApi.GetSeries(sonarrSettings.ApiKey, sonarrSettings.FullUri)).ConfigureAwait(false);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html ng-app="PlexRequests">
|
||||
@Html.Partial("Shared/Partial/_Head")
|
||||
|
||||
<body>
|
||||
<body>@Html.LoadAngularAssets()
|
||||
|
||||
@Html.Partial("Shared/Partial/_Navbar")
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@using PlexRequests.UI.Helpers
|
||||
@inherits PlexRequests.UI.Helpers.AngularViewBase
|
||||
@Html.LoadAngularAssets()
|
||||
|
||||
<script src="~/Content/app/userManagement/userManagementController.js"></script>
|
||||
<script src="~/Content/app/userManagement/userManagementService.js"></script>
|
||||
<div ng-controller="userManagementController" ng-init="init()">
|
||||
|
@ -90,10 +90,10 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 col-md-push-1" ng-show="selectedUser.username">
|
||||
<div class="col-md-5 col-md-push-1 user-management-menu" ng-show="selectedUser.username">
|
||||
<br />
|
||||
<br />
|
||||
<img ng-src="{{selectedUser.plexInfo.thumb}}" />
|
||||
<img ng-show="selectedUser.plexInfo.thumb" class="col-md-pull-1 img-circle" style="position: absolute" ng-src="{{selectedUser.plexInfo.thumb}}" />
|
||||
<div hidden="hidden" ng-bind="selectedUser.id"></div>
|
||||
<div>
|
||||
<strong>Username: </strong><span ng-bind="selectedUser.username"></span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue