Skip to content

Commit

Permalink
Support for catholic and lutheran metric books
Browse files Browse the repository at this point in the history
  • Loading branch information
okolobaxa committed Dec 25, 2021
1 parent ca2fb17 commit b34f5db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions DataParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ internal static class DataParser
"203", "520", "592", "1607", "1813", "2055", "2121", "2122", "2123", "2124", "2125", "2126", "2127", "2130", "2131", "2132", "2395"
};

private static readonly HashSet<string> MetricBookCatholicismFonds = new HashSet<string>
{
"609", "2193", "2197"
};

private static readonly HashSet<string> MetricBookLutheranismFonds = new HashSet<string>
{
"1476", "1477", "2099"
};

public static async ValueTask<PageData> GetPageData(ArchiveRecord record)
{
try
Expand All @@ -26,6 +36,8 @@ public static async ValueTask<PageData> GetPageData(ArchiveRecord record)
"2125" => $"https://cgamos.ru/ispovedalnye_vedomosti/{record.Fond}-{record.Opis}-{record.Delo}/",
"2372" => $"https://cgamos.ru/inye-konfessii/iudaizm/{record.Fond}-{record.Opis}-{record.Delo}/",
_ when MetricBookFonds.Contains(record.Fond) => $"https://cgamos.ru/metric-books/{record.Fond}/{record.Fond}-{record.Opis}/{record.Fond}_{record.Opis}_{record.Delo}/",
_ when MetricBookCatholicismFonds.Contains(record.Fond) => $"https://cgamos.ru/inye-konfessii/catholicism/{record.Fond}-{record.Opis}-{record.Delo}/",
_ when MetricBookLutheranismFonds.Contains(record.Fond) => $"https://cgamos.ru/inye-konfessii/lutheranism/{record.Fond}-{record.Opis}-{record.Delo}/",
_ => throw new ArgumentOutOfRangeException(record.Fond)
};

Expand Down
2 changes: 1 addition & 1 deletion cgamos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net60</TargetFramework>
<Version>1.6</Version>
<Version>1.7</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Downloader" Version="2.3.0"/>
Expand Down

0 comments on commit b34f5db

Please sign in to comment.