-
-
Notifications
You must be signed in to change notification settings - Fork 516
[Canary] Transcoding support using NetVips #3978
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
base: canary
Are you sure you want to change the base?
Changes from 1 commit
a1ce3e2
dbba9aa
b21baaf
33b62a1
31fcbc9
995c47d
7bfde6a
bb67141
39a6fe5
ec60add
c738137
900c20d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -61,7 +61,9 @@ private static void AddExtension(List<string> extensions, string extension) | |||||||||||||
| if (string.IsNullOrEmpty(extension)) | ||||||||||||||
| return; | ||||||||||||||
| if (!extensions.Contains(extension)) | ||||||||||||||
| { | ||||||||||||||
| extensions.Add(extension); | ||||||||||||||
| } | ||||||||||||||
|
||||||||||||||
| } | |
| private static void AddExtension(HashSet<string> extensions, string extension) | |
| { | |
| if (string.IsNullOrEmpty(extension)) | |
| return; | |
| extensions.Add(extension); |
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 should be on the same line as the if
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.
I'd like some safety checks in the crazy off chance we don't have anything in the header.
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.
agree, will do
Outdated
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.
Inversion of Control here please
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.
Inversion of control means instead of doing if (condition) {}, inverting the condition, exist early then the body of the if doesn't need to be indented.
Outdated
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.
Newline above. Since there is a jump statement above, a newline helps bring that to the reader's attention.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -477,7 +477,7 @@ public async Task SetPersonCoverByUrl(Person person, string url, bool fromBase64 | |
| if (checkNoImagePlaceholder) | ||
| { | ||
| var placeholderPath = Path.Combine(_directoryService.AssetsDirectory, "anilist-no-image-placeholder.jpg"); | ||
| var similarity = _imageService.ImageFactory.CalculateSimilarity(placeholderPath, tempFullPath); | ||
| var similarity = _imageService.CalculateSimilarity(placeholderPath, tempFullPath); | ||
| if (similarity >= 0.9f) | ||
| { | ||
| _logger.LogInformation("Skipped setting placeholder image for person {PersonId} due to high similarity ({Similarity})", person.Id, similarity); | ||
|
|
@@ -491,7 +491,7 @@ public async Task SetPersonCoverByUrl(Person person, string url, bool fromBase64 | |
| if (!string.IsNullOrEmpty(person.CoverImage)) | ||
| { | ||
| var existingPath = Path.Combine(_directoryService.CoverImageDirectory, person.CoverImage); | ||
| var betterImage = _imageService.ImageFactory.GetBetterImage(existingPath,tempFullPath)!; | ||
| var betterImage = _imageService.GetBetterImage(existingPath, tempFullPath)!; | ||
|
|
||
| var choseNewImage = string.Equals(betterImage, tempFullPath, StringComparison.OrdinalIgnoreCase); | ||
| if (choseNewImage) | ||
|
|
@@ -569,7 +569,7 @@ public async Task SetSeriesCoverByUrl(Series series, string url, bool fromBase64 | |
| try | ||
| { | ||
| var existingPath = Path.Combine(_directoryService.CoverImageDirectory, series.CoverImage); | ||
| var betterImage =_imageService.ImageFactory.GetBetterImage(existingPath, tempFullPath)!; | ||
| var betterImage =_imageService.GetBetterImage(existingPath, tempFullPath)!; | ||
|
||
|
|
||
| var choseNewImage = string.Equals(betterImage, tempFullPath, StringComparison.OrdinalIgnoreCase); | ||
| if (choseNewImage) | ||
|
|
@@ -646,7 +646,7 @@ public async Task SetChapterCoverByUrl(Chapter chapter, string url, bool fromBas | |
| try | ||
| { | ||
| var existingPath = Path.Combine(_directoryService.CoverImageDirectory, chapter.CoverImage); | ||
| var betterImage = _imageService.ImageFactory.GetBetterImage(existingPath,tempFullPath)!; | ||
| var betterImage = _imageService.GetBetterImage(existingPath,tempFullPath)!; | ||
|
||
| var choseNewImage = string.Equals(betterImage, tempFullPath, StringComparison.OrdinalIgnoreCase); | ||
|
|
||
| if (choseNewImage) | ||
|
|
||
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.
Anytime you don't use {} on an if statement, it must be on one line and MUST be a jump operation (return/continue/break). All other times, you must use {} and be on 2 lines.