mirror of
https://github.com/cxfksword/jellyfin-plugin-danmu.git
synced 2026-02-02 17:59:58 +08:00
perf: dandan api speed limit
This commit is contained in:
@@ -80,7 +80,7 @@ public class DandanApi : AbstractApi
|
||||
}
|
||||
|
||||
var cacheKey = $"search_{keyword}";
|
||||
var expiredOption = new MemoryCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(5) };
|
||||
var expiredOption = new MemoryCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(30) };
|
||||
if (_memoryCache.TryGetValue<List<Anime>>(cacheKey, out var searchResult))
|
||||
{
|
||||
return searchResult;
|
||||
@@ -219,6 +219,8 @@ public class DandanApi : AbstractApi
|
||||
throw new ArgumentNullException(nameof(epId));
|
||||
}
|
||||
|
||||
this.LimitRequestFrequently();
|
||||
|
||||
var withRelated = this.Config.WithRelatedDanmu ? "true" : "false";
|
||||
var chConvert = this.Config.ChConvert;
|
||||
var url = $"https://api.dandanplay.net/api/v2/comment/{epId}?withRelated={withRelated}&chConvert={chConvert}";
|
||||
|
||||
Reference in New Issue
Block a user