-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Tvdb Collection Ids #162
Conversation
if (isOfficial is true) | ||
{ | ||
var id = jsonElementCollection.GetProperty("id").GetInt32().ToString(CultureInfo.InvariantCulture); | ||
collectionIds += id + ";"; |
Check notice
Code scanning / CodeQL
String concatenation in loop Note
foreach (var collection in collections) | ||
{ | ||
if (collection is JsonElement jsonElementCollection) | ||
{ | ||
var isOfficial = jsonElementCollection.GetProperty("isOfficial").GetBoolean(); | ||
if (isOfficial is true) | ||
{ | ||
var id = jsonElementCollection.GetProperty("id").GetInt32().ToString(CultureInfo.InvariantCulture); | ||
collectionIds += id + ";"; | ||
} | ||
} | ||
} |
Check notice
Code scanning / CodeQL
Missed opportunity to use Where Note
.Where(x => x.GetProperty("isOfficial").GetBoolean()) | ||
.Select(x => x.GetProperty("id").GetInt32().ToString(CultureInfo.InvariantCulture)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks super clean but this would throw an exception if a property is missing or not a bool/int
Can't rely on tvdb to be consistent 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, these two property is always present.
I can wrap a try catch around this.
A series can have multiple tvdb collection ids. So store them as a string and delimit them with semicolons.
For use for future tvdb collection management