-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Enforce unique speaker names; Use name on export #3018
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3018 +/- ##
==========================================
+ Coverage 74.25% 74.66% +0.41%
==========================================
Files 269 269
Lines 10323 10374 +51
Branches 1217 1229 +12
==========================================
+ Hits 7665 7746 +81
+ Misses 2306 2271 -35
- Partials 352 357 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Commit 90fd600 in this pr deals with inconsistent The backend tests of the previous commit (002ca43) fail on Ubuntu 20.02 but not on Windows 11. |
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.
Reviewed 3 of 7 files at r1, 10 of 11 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @imnasnainaec)
Backend/Controllers/SpeakerController.cs
line 210 at r3 (raw file):
if (await _speakerRepo.IsSpeakerNameInProject(projectId, name)) { return BadRequest("projectSettings.speaker.nameTaken");
This is a duplicate of the code in CreateSpeaker
. Pull out into a separate function so that it is only implemented once.
Code quote:
// Ensure the new name is valid
name = name.Trim();
if (string.IsNullOrEmpty(name))
{
return BadRequest("projectSettings.speaker.nameEmpty");
}
if (await _speakerRepo.IsSpeakerNameInProject(projectId, name))
{
return BadRequest("projectSettings.speaker.nameTaken");
Backend/Services/LiftService.cs
line 365 at r3 (raw file):
var fileExt = Path.GetExtension(src); var convertToWav = fileExt.Equals(".webm", StringComparison.OrdinalIgnoreCase); fileExt = convertToWav ? ".wav" : fileExt;
This logic seems extra complex. I find this easier to read:
if (fileExt.Equals(".webm", StringComparison.OrdinalIgnoreCase)
{
fileExt = ".wav";
}
Code quote:
var convertToWav = fileExt.Equals(".webm", StringComparison.OrdinalIgnoreCase);
fileExt = convertToWav ? ".wav" : fileExt;
Backend/Services/LiftService.cs
line 371 at r3 (raw file):
{ dest = Path.ChangeExtension(dest, fileExt); }
This should also be put into a utility function rather than having multiple copies (see below and FileStorage.cs
.
Code quote:
if (!string.IsNullOrEmpty(fileExt))
{
dest = Path.ChangeExtension(dest, fileExt);
}
public/locales/en/translation.json
line 205 at r3 (raw file):
"enterName": "Enter the name of a new speaker", "nameEmpty": "Speaker name is empty", "nameTaken": "Speaker name is already taken",
Would it be better to say something like: "Speaker name is already taken in this project"? (or something like that)
Code quote:
"nameTaken": "Speaker name is already taken",
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.
Reviewable status: 12 of 14 files reviewed, 2 unresolved discussions (waiting on @jmgrady)
Backend/Controllers/SpeakerController.cs
line 210 at r3 (raw file):
Previously, jmgrady (Jim Grady) wrote…
This is a duplicate of the code in
CreateSpeaker
. Pull out into a separate function so that it is only implemented once.
Done.
Backend/Services/LiftService.cs
line 365 at r3 (raw file):
Previously, jmgrady (Jim Grady) wrote…
This logic seems extra complex. I find this easier to read:
if (fileExt.Equals(".webm", StringComparison.OrdinalIgnoreCase) { fileExt = ".wav"; }
The convertToWav
was defined to avoid a double if (fileExt.Equals(".webm", StringComparison.OrdinalIgnoreCase)
check. (Note the if (convertToWav)
below.)
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.
Reviewable status: 10 of 15 files reviewed, 2 unresolved discussions (waiting on @jmgrady)
Backend/Services/LiftService.cs
line 371 at r3 (raw file):
Previously, jmgrady (Jim Grady) wrote…
This should also be put into a utility function rather than having multiple copies (see below and
FileStorage.cs
.
Done.
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.
Reviewed 2 of 2 files at r4, 3 of 3 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
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.
Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
Resolves #3010
This change is