Skip to content

Commit

Permalink
Fix Recently Added Episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Jun 15, 2019
1 parent d63ff7d commit 3435929
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Shoko.Commons
5 changes: 5 additions & 0 deletions Shoko.Server/API/v2/Modules/Common.cs
Expand Up @@ -1157,16 +1157,21 @@ public List<Episode> GetRecentEpisodes([FromQuery] API_Call_Parameters para)
para.limit = 10;
}
List<Episode> lst = new List<Episode>();
HashSet<int> IDs = new HashSet<int>();

List<SVR_VideoLocal> vids = RepoFactory.VideoLocal.GetMostRecentlyAdded(para.limit, user.JMMUserID);

foreach (SVR_VideoLocal vl in vids)
{
foreach (SVR_AnimeEpisode aep in vl.GetAnimeEpisodes())
{
if (IDs.Contains(aep.AnimeEpisodeID)) continue;
Episode ep = Episode.GenerateFromAnimeEpisode(HttpContext, aep, user.JMMUserID, para.level, para.pic);
if (ep != null)
{
IDs.Add(aep.AnimeEpisodeID);
lst.Add(ep);
}
}
}

Expand Down

0 comments on commit 3435929

Please sign in to comment.