mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-10 07:22:35 -07:00
Started working on #26
This commit is contained in:
parent
2b20af5df0
commit
748fe2ca2d
6 changed files with 169 additions and 8 deletions
|
@ -106,6 +106,8 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
Post["/notifyuser"] = x => NotifyUser((bool)Request.Form.notify);
|
||||
Get["/notifyuser"] = x => GetUserNotificationSettings();
|
||||
|
||||
Get["/seasons"] = x => GetSeasons();
|
||||
}
|
||||
private IPlexApi PlexApi { get; }
|
||||
private TheMovieDbApi MovieApi { get; }
|
||||
|
@ -942,11 +944,20 @@ namespace PlexRequests.UI.Modules
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
public Response GetUserNotificationSettings()
|
||||
private Response GetUserNotificationSettings()
|
||||
{
|
||||
var retval = UsersToNotifyRepo.GetAll().FirstOrDefault(x => x.Username == Username);
|
||||
return Response.AsJson(retval != null);
|
||||
}
|
||||
|
||||
private Response GetSeasons()
|
||||
{
|
||||
var tv = new TvMazeApi();
|
||||
var seriesId = (int)Request.Query.tvId;
|
||||
var show = tv.ShowLookupByTheTvDbId(seriesId);
|
||||
var seasons = tv.GetSeasons(show.id);
|
||||
var model = seasons.Select(x => x.number);
|
||||
return Response.AsJson(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue