Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
Jackett
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
Jackett
Commits
010135da
Commit
010135da
authored
Apr 19, 2015
by
zone117x
Browse files
Options
Downloads
Patches
Plain Diff
Strip parenthesis from show titles - fix for morethantv
parent
b68e4c05
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Jackett/SonarApi.cs
+11
-5
11 additions, 5 deletions
src/Jackett/SonarApi.cs
with
11 additions
and
5 deletions
src/Jackett/SonarApi.cs
+
11
−
5
View file @
010135da
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
...
...
@@ -45,7 +46,7 @@ namespace Jackett
HttpClientHandler
handler
;
HttpClient
client
;
Dictionary
<
int
,
string
[
]>
IdNameMappings
;
Concurrent
Dictionary
<
int
,
string
[
]>
IdNameMappings
;
public
SonarrApi
()
{
...
...
@@ -60,7 +61,7 @@ namespace Jackett
};
client
=
new
HttpClient
(
handler
);
IdNameMappings
=
new
Dictionary
<
int
,
string
[
]>
();
IdNameMappings
=
new
Concurrent
Dictionary
<
int
,
string
[
]>
();
}
async
Task
ReloadNameMappings
(
string
host
,
int
port
,
string
apiKey
)
...
...
@@ -74,15 +75,20 @@ namespace Jackett
foreach
(
var
item
in
json
)
{
var
titles
=
new
List
<
string
>();
titles
.
Add
((
string
)
item
[
"title"
]);
titles
.
Add
(
SanitizeTitle
(
(
string
)
item
[
"title"
])
)
;
foreach
(
var
t
in
item
[
"alternateTitles"
])
{
titles
.
Add
((
string
)
t
[
"title"
]);
titles
.
Add
(
SanitizeTitle
(
(
string
)
t
[
"title"
])
)
;
}
IdNameMappings
.
Add
((
int
)
item
[
"tvRageId"
],
titles
.
ToArray
());
IdNameMappings
.
Try
Add
((
int
)
item
[
"tvRageId"
],
titles
.
ToArray
());
}
}
string
SanitizeTitle
(
string
title
)
{
return
title
.
Replace
(
"("
,
""
).
Replace
(
")"
,
""
);
}
void
LoadSettings
()
{
try
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment