Skip to content

Commit

Permalink
proxy for raw github content if country is india
Browse files Browse the repository at this point in the history
  • Loading branch information
insomniachi committed Dec 26, 2023
1 parent 14180f1 commit 41fe101
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Totoro.Core/Services/OfflineAnimeIdService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ private FrozenDictionary<long, AnimeIdExtended> GetMapping(ListServiceType type)
ListServiceType.AniList => _ids.Where(x => x.AniList.HasValue).ToFrozenDictionary(x => x.AniList.Value),
ListServiceType.Kitsu => _ids.Where(x => x.Kitsu.HasValue).ToFrozenDictionary(x => x.Kitsu.Value),
ListServiceType.AniDb => _ids.Where(x => x.AniDb.HasValue).ToFrozenDictionary(x => x.AniDb.Value),
ListServiceType.Simkl => FrozenDictionary<long,AnimeIdExtended>.Empty,
_ => throw new UnreachableException(),
_ => FrozenDictionary<long, AnimeIdExtended>.Empty,
};
}
}
6 changes: 6 additions & 0 deletions Totoro.Plugins/PluginManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Globalization;
using Flurl;
using Flurl.Http;
using Splat;
Expand Down Expand Up @@ -35,6 +36,11 @@ public PluginManager(IPluginFactory animePluginFactory,
_mangaPluginFactory = mangaPluginFactory;
_torrentPluginFactory = torrentPluginFactory;
_mediaDetectionPluginFactory = mediaDetectionPluginFactory;

if(RegionInfo.CurrentRegion.EnglishName.Equals("India", StringComparison.OrdinalIgnoreCase))
{
_baseUrl = "https://rawgithubusercontent.deno.dev/insomniachi/Totoro/main";
}
}

public async ValueTask<PluginIndex?> GetAllPlugins()
Expand Down

0 comments on commit 41fe101

Please sign in to comment.