File tree 5 files changed +5
-21
lines changed
5 files changed +5
-21
lines changed Original file line number Diff line number Diff line change 1
1
using LibHandler . Models ;
2
2
using LibHandler . Util ;
3
- using Newtonsoft . Json ;
3
+ using System . Text . Json ;
4
4
5
5
namespace LibHandler
6
6
{
@@ -49,9 +49,8 @@ public static List<Book> GetBooks(string request)
49
49
{
50
50
List < string > ids = GetIDs ( request ) ;
51
51
string jsonData = GetJSONData ( ids ) ;
52
- return JsonConvert . DeserializeObject < List < Book > > ( jsonData ) ?? new List < Book > ( ) ;
52
+ return JsonSerializer . Deserialize < List < Book > > ( jsonData ) ?? new List < Book > ( ) ;
53
53
}
54
-
55
54
/// <summary>
56
55
/// Returns the current mirror.
57
56
/// </summary>
Original file line number Diff line number Diff line change 32
32
33
33
<ItemGroup >
34
34
<PackageReference Include =" HtmlAgilityPack" Version =" 1.11.46" />
35
- <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.3" />
36
35
</ItemGroup >
37
36
38
37
</Project >
Original file line number Diff line number Diff line change 4
4
"FullUrl" : " https://libgen.is" ,
5
5
"DownloadUrl" : " http://library.lol/"
6
6
},
7
- {
8
- "Url" : " libgen.gs" ,
9
- "FullUrl" : " https://libgen.gs" ,
10
- "DownloadUrl" : " http://library.lol/"
11
- },
12
7
{
13
8
"Url" : " libgen.rs" ,
14
9
"FullUrl" : " https://libgen.rs" ,
Original file line number Diff line number Diff line change 1
- using System ;
2
- using System . Collections . Generic ;
3
- using System . Linq ;
4
- using System . Reflection ;
5
- using System . Text ;
6
- using System . Threading . Tasks ;
7
-
8
- namespace LibHandler . Util
1
+ namespace LibHandler . Util
9
2
{
10
3
internal static class DataHandler
11
4
{
Original file line number Diff line number Diff line change 1
- using Newtonsoft . Json ;
2
- using System . Linq ;
3
- using System . Text . Json ;
1
+ using System . Text . Json ;
4
2
using System . Net . NetworkInformation ;
5
3
using System . Reflection ;
6
4
@@ -35,7 +33,7 @@ static MirrorHandler()
35
33
36
34
//string config = File.ReadAllText(DataHandler.MIRROR_CONFIG_PATH);
37
35
string config = reader . ReadToEnd ( ) ;
38
- Mirrors = JsonConvert . DeserializeObject < List < Mirror > > ( config ) ?? new List < Mirror > ( ) ;
36
+ Mirrors = JsonSerializer . Deserialize < List < Mirror > > ( config ) ?? new List < Mirror > ( ) ;
39
37
40
38
MainMirror = new Mirror ( ) ;
41
39
MainMirror = GetMainMirror ( ) ;
You can’t perform that action at this time.
0 commit comments