Skip to content

Commit

Permalink
Merge pull request #68 from jellyfin/limit-people
Browse files Browse the repository at this point in the history
  • Loading branch information
crobibero authored May 13, 2024
2 parents b04ed7d + 6fc1f5c commit b3d9127
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [hawken93](https://github.com/hawken93)
- [dkanada](https://github.com/dkanada)
- [StillLoading](https://github.com/StillLoading)
- [AkaTenshi](https://github.com/AkaTenshi)

# Emby Contributors

Expand Down
3 changes: 3 additions & 0 deletions Jellyfin.Plugin.AniList/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public PluginConfiguration()
TitlePreference = TitlePreferenceType.Localized;
OriginalTitlePreference = TitlePreferenceType.JapaneseRomaji;
PersonLanguageFilterPreference = LanguageFilterType.All;
MaxPeople = 0;
MaxGenres = 5;
AnimeDefaultGenre = AnimeDefaultGenreType.Anime;
AniDbRateLimit = 2000;
Expand All @@ -52,6 +53,8 @@ public PluginConfiguration()

public LanguageFilterType PersonLanguageFilterPreference { get; set; }

public int MaxPeople { get; set; }

public int MaxGenres { get; set; }

public AnimeDefaultGenreType AnimeDefaultGenre { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions Jellyfin.Plugin.AniList/Configuration/configPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
</select>
<div class="fieldDescription">This setting will only keep people with chosen language. Choosing Localized will retain everybody except Japanese VAs.</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="chkMaxPeople">Max People</label>
<input id="chkMaxPeople" name="chkMaxPeople" type="number" is="emby-input" min="0" />
<div class="fieldDescription">Set this to zero to remove any limit.</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="chkMaxGenres">Max Genres</label>
<input id="chkMaxGenres" name="chkMaxGenres" type="number" is="emby-input" min="0" />
Expand Down Expand Up @@ -91,6 +96,7 @@
document.getElementById('titleLanguage').value = config.TitlePreference;
document.getElementById('originalTitleLanguage').value = config.OriginalTitlePreference;
document.getElementById('filterPeopleByLanguage').value = config.PersonLanguageFilterPreference;
document.getElementById('chkMaxPeople').value = config.MaxPeople;
document.getElementById('chkMaxGenres').value = config.MaxGenres;
document.getElementById('animeDefaultGenre').value = config.AnimeDefaultGenre;
document.getElementById('chkAniDbRateLimit').value = config.AniDbRateLimit;
Expand All @@ -109,6 +115,7 @@
config.TitlePreference = document.getElementById('titleLanguage').value;
config.OriginalTitlePreference = document.getElementById('originalTitleLanguage').value;
config.PersonLanguageFilterPreference = document.getElementById('filterPeopleByLanguage').value;
config.MaxPeople = document.getElementById('chkMaxPeople').value;
config.MaxGenres = document.getElementById('chkMaxGenres').value;
config.AnimeDefaultGenre = document.getElementById('animeDefaultGenre').value;
config.AniDbRateLimit = document.getElementById('chkAniDbRateLimit').value;
Expand Down
6 changes: 6 additions & 0 deletions Jellyfin.Plugin.AniList/Providers/AniList/ApiModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ public List<PersonInfo> GetPeopleInfo()
});
}
}

if (config.MaxPeople > 0)
{
lpi = lpi.Take(config.MaxPeople).ToList();
}

return lpi;
}

Expand Down

0 comments on commit b3d9127

Please sign in to comment.