You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewArgumentException($"Invalid limit provided in {GetType().Name}. Valid limits are 1-100");
33
+
_limit=limit;
34
+
returnthis;
35
+
}
36
+
37
+
/// <summary>
38
+
/// Defines an IMDb ID for filtering recent torrents
39
+
/// </summary>
40
+
/// <param name="imdb"></param>
41
+
/// <returns>FileListLatestParams</returns>
42
+
/// <exception cref="ArgumentException">In case incorrect IMDb ID is provided</exception>
43
+
publicFileListLatestParamsImdb(stringimdb)
44
+
{
45
+
if(!ImdbRegex().IsMatch(imdb))
46
+
{
47
+
thrownewArgumentException(
48
+
"When using the IMDb search type you can only use IMDb IDs (as tt0000000 or 0000000)");
49
+
}
50
+
51
+
_imdb=imdb;
52
+
returnthis;
53
+
}
54
+
55
+
/// <summary>
56
+
/// Defines an array of categories for filtering recent torrents, for information on that IDs are which access <see href="https://gist.github.com/alexthemaster/c4a64a718e5db2128a8b179ff1ca86e3">this</see>
57
+
/// </summary>
58
+
/// <param name="categories">An array of catogories</param>
59
+
/// <returns>FileListLatestParams</returns>
60
+
/// <exception cref="ArgumentException">If incorrect category ID is provided</exception>
if(_queryisnull)thrownewArgumentNullException("Query",$"The query for {GetType().Name} cannot be null.");
24
+
varfinal=$"type={_type}&query={_query}";
25
+
26
+
if(_categoryis not null)final+=$"&category={string.Join(',',_category)}";
27
+
if(_moderatedis not null)final+=$"&moderated={_moderated}";
28
+
if(_internalis not null)final+=$"&internal={_internal}";
29
+
if(_freeleechis not null)final+=$"&freeleech={_freeleech}";
30
+
if(_doubleupis not null)final+=$"&doubleup={_doubleup}";
31
+
if(_seasonis not null)final+=$"&season={_season}";
32
+
if(_episodeis not null)final+=$"&episode={_episode}";
33
+
34
+
returnfinal;
35
+
}
36
+
37
+
/// <summary>
38
+
/// Whether to search torrents based on its name or its tagged IMDb ID <br/> Defaults to <c>name</c>
39
+
/// </summary>
40
+
/// <param name="type">name or imdb</param>
41
+
/// <returns>FileListSearchParams</returns>
42
+
/// <exception cref="ArgumentException">If type is neither name nor imdb</exception>
43
+
publicFileListSearchParamsType(stringtype)
44
+
{
45
+
type=type.ToLower();
46
+
if(typeis"name" or "imdb")
47
+
{
48
+
_type=type;
49
+
}
50
+
else
51
+
{
52
+
thrownewArgumentException("The type can only be name or imdb.");
53
+
}
54
+
55
+
returnthis;
56
+
}
57
+
58
+
/// <summary>
59
+
/// The query for the search (name of the torrent or an IMDb ID)
60
+
/// </summary>
61
+
/// <param name="query"></param>
62
+
/// <returns>FileListSearchParams</returns>
63
+
/// <exception cref="ArgumentException">If search type is IMDb but no valid IMDb ID is provided</exception>
64
+
publicFileListSearchParamsQuery(stringquery)
65
+
{
66
+
{
67
+
if(_typeis"imdb")
68
+
{
69
+
if(ImdbRegex().IsMatch(query))
70
+
{
71
+
_query=query;
72
+
}
73
+
else
74
+
{
75
+
thrownewArgumentException(
76
+
"When using the IMDb search type you can only use IMDb ids (as tt0000000 or 0000000)");
77
+
}
78
+
}
79
+
else
80
+
{
81
+
_query=query;
82
+
}
83
+
}
84
+
85
+
returnthis;
86
+
}
87
+
88
+
/// <summary>
89
+
/// Defines an array of categories for filtering the searched torrents, for information on that IDs are which access <see href="https://gist.github.com/alexthemaster/c4a64a718e5db2128a8b179ff1ca86e3">this</see>
90
+
/// </summary>
91
+
/// <param name="categories">An array of catogories</param>
92
+
/// <returns>FileListSearchParams</returns>
93
+
/// <exception cref="ArgumentException">If incorrect category ID is provided</exception>
0 commit comments