mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 17:11:10 +00:00
Removes track path editing from the music track update flow
Stops Track.UpdateDetails and Artist.UpdateTrackInAlbum from assigning a path, so a track path can be set only when the track is created. Removes Path from UpdateTrackRequest, UpdateTrackCommand, UpdateTrackCommandValidator and UpdateMusicTrackRequest, and removes the path containment check and IPathService dependency from UpdateTrackCommandHandler. The path stays visible in TrackResponse, MusicTrackDto and the read-only field of the track page. Updates the endpoint summary, request and API docs, and the affected tests.
This commit is contained in:
1 parent
728a879bb8
commit
1aa427b1e2
29 files changed
+47
-243
No files matched your search
+3
-5
@@ -661,7 +661,7 @@ public class ArtistTests
|
||||
Track track = _trackFixture.Create();
|
||||
Album album = _albumFixture.Create(tracks: [track]);
|
||||
Artist artist = _artistFixture.Create(albums: [album]);
|
||||
string path = "C:\\Music\\queen\\bohemian-rhapsody.flac";
|
||||
string originalPath = track.Path;
|
||||
AudioMetadata metadata = _audioMetadataFixture.Create();
|
||||
Optional<string> disambiguation = Optional<string>.Some("remastered");
|
||||
Optional<int> discNumber = Optional<int>.Some(1);
|
||||
@@ -681,7 +681,6 @@ public class ArtistTests
|
||||
Result<Updated> result = artist.UpdateTrackInAlbum(
|
||||
album,
|
||||
track,
|
||||
path,
|
||||
metadata,
|
||||
disambiguation,
|
||||
11,
|
||||
@@ -700,7 +699,8 @@ public class ArtistTests
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal(path, track.Path);
|
||||
// The file system path is not part of the track update, it is set only when the track is created.
|
||||
Assert.Equal(originalPath, track.Path);
|
||||
Assert.Equal(metadata, track.Metadata);
|
||||
Assert.Equal(disambiguation, track.Disambiguation);
|
||||
Assert.Equal(11, track.TrackNumber);
|
||||
@@ -735,7 +735,6 @@ public class ArtistTests
|
||||
Result<Updated> result = artist.UpdateTrackInAlbum(
|
||||
foreignAlbum,
|
||||
track,
|
||||
"C:\\Music\\queen\\bohemian-rhapsody.flac",
|
||||
_audioMetadataFixture.Create(),
|
||||
Optional<string>.None(),
|
||||
11,
|
||||
@@ -773,7 +772,6 @@ public class ArtistTests
|
||||
Result<Updated> result = artist.UpdateTrackInAlbum(
|
||||
album,
|
||||
track,
|
||||
"C:\\Music\\queen\\bohemian-rhapsody.flac",
|
||||
_audioMetadataFixture.Create(),
|
||||
Optional<string>.None(),
|
||||
11,
|
||||
|
||||
+4
-5
@@ -190,8 +190,8 @@ public class TrackTests
|
||||
{
|
||||
// Arrange
|
||||
Track track = _trackFixture.Create();
|
||||
string originalPath = track.Path;
|
||||
List<Mood> originalMoods = [.. track.Moods];
|
||||
string path = "C:\\Music\\queen\\bohemian-rhapsody.flac";
|
||||
AudioMetadata metadata = _audioMetadataFixture.Create();
|
||||
Optional<string> disambiguation = Optional<string>.Some("remastered");
|
||||
Optional<int> discNumber = Optional<int>.Some(2);
|
||||
@@ -206,7 +206,6 @@ public class TrackTests
|
||||
|
||||
// Act
|
||||
Result<Updated> result = track.UpdateDetails(
|
||||
path,
|
||||
metadata,
|
||||
disambiguation,
|
||||
7,
|
||||
@@ -221,7 +220,6 @@ public class TrackTests
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal(path, track.Path);
|
||||
Assert.Equal(metadata, track.Metadata);
|
||||
Assert.Equal(disambiguation, track.Disambiguation);
|
||||
Assert.Equal(7, track.TrackNumber);
|
||||
@@ -235,7 +233,9 @@ public class TrackTests
|
||||
Assert.Equal(trackId, track.MusicBrainzTrackId);
|
||||
Assert.True(track.UpdatedOnUtc.HasValue);
|
||||
Assert.True(track.UpdatedOnUtc.Value >= beforeUpdate);
|
||||
// the collections are not part of the details update
|
||||
// The file system path is not part of the details update, it is set only when the track is created.
|
||||
Assert.Equal(originalPath, track.Path);
|
||||
// The collections are not part of the details update.
|
||||
Assert.Equal(originalMoods, track.Moods);
|
||||
}
|
||||
|
||||
@@ -376,7 +376,6 @@ public class TrackTests
|
||||
|
||||
// Act
|
||||
Result<Updated> result = track.UpdateDetails(
|
||||
"C:\\Music\\queen\\bohemian-rhapsody.flac",
|
||||
_audioMetadataFixture.Create(),
|
||||
Optional<string>.None(),
|
||||
11,
|
||||
|
||||
Reference in new issue
Block a user