diff --git a/VocaDbModel/Domain/Songs/Song.cs b/VocaDbModel/Domain/Songs/Song.cs index 985ab4fc78..df7f7e8a46 100644 --- a/VocaDbModel/Domain/Songs/Song.cs +++ b/VocaDbModel/Domain/Songs/Song.cs @@ -227,7 +227,7 @@ public virtual DateTime? FirstAlbumDate /// This method also tests that the song type isn't "Original", because original songs aren't supposed to have parent songs. /// [MemberNotNullWhen(true, nameof(OriginalVersion))] - public virtual bool HasOriginalVersion => SongType != SongType.Original && OriginalVersion != null; + public virtual bool HasOriginalVersion => OriginalVersion != null; public virtual IList Hits { diff --git a/VocaDbWeb/Models/SongModels.cs b/VocaDbWeb/Models/SongModels.cs index e894d9fc7b..d0c454e711 100644 --- a/VocaDbWeb/Models/SongModels.cs +++ b/VocaDbWeb/Models/SongModels.cs @@ -34,7 +34,7 @@ public SongDetails(SongDetailsContract contract, IUserPermissionContext userCont Contract = contract; AdditionalNames = contract.AdditionalNames; Albums = contract.Albums; - AlternateVersions = contract.AlternateVersions.Where(a => a.SongType != SongType.Original).ToArray(); + AlternateVersions = contract.AlternateVersions; ArtistString = contract.ArtistString; BrowsedAlbumId = contract.Album?.Id; CanEdit = EntryPermissionManager.CanEdit(userContext, contract.Song); @@ -58,7 +58,7 @@ public SongDetails(SongDetailsContract contract, IUserPermissionContext userCont Name = contract.Song.Name; NicoId = contract.Song.NicoId; Notes = contract.Notes; - OriginalVersion = (contract.Song.SongType != SongType.Original ? contract.OriginalVersion : null); + OriginalVersion = contract.OriginalVersion; Pools = contract.Pools; PublishDate = contract.Song.PublishDate; RatingScore = contract.Song.RatingScore; diff --git a/VocaDbWeb/New/types/DataContracts/Song/SongDetailsForApi.ts b/VocaDbWeb/New/types/DataContracts/Song/SongDetailsForApi.ts index 5d56006c8b..1f0cc6eddf 100644 --- a/VocaDbWeb/New/types/DataContracts/Song/SongDetailsForApi.ts +++ b/VocaDbWeb/New/types/DataContracts/Song/SongDetailsForApi.ts @@ -76,9 +76,7 @@ export class SongDetailsForApi { constructor(readonly contract: SongDetailsContract, primaryPV: PVContract | undefined) { this.additionalNames = contract.additionalNames; this.albums = contract.albums; - this.alternateVersions = contract.alternateVersions.filter( - (a) => a.songType !== SongType.Original - ); + this.alternateVersions = contract.alternateVersions; this.artistString = contract.artistString; this.browsedAlbumId = contract.album?.id; this.canEditPersonalDescription = contract.canEditPersonalDescription; @@ -101,10 +99,7 @@ export class SongDetailsForApi { this.minMilliBpm = contract.minMilliBpm; this.name = contract.song.name; this.notes = contract.notes; - - this.originalVersion = - contract.song.songType !== SongType.Original ? contract.originalVersion : undefined; - + this.originalVersion = contract.originalVersion; this.personalDescriptionAuthor = contract.personalDescriptionAuthor; this.personalDescriptionText = contract.personalDescriptionText; this.pools = contract.pools; diff --git a/VocaDbWeb/Scripts/DataContracts/Song/SongDetailsForApi.ts b/VocaDbWeb/Scripts/DataContracts/Song/SongDetailsForApi.ts index f323703343..f722027e1e 100644 --- a/VocaDbWeb/Scripts/DataContracts/Song/SongDetailsForApi.ts +++ b/VocaDbWeb/Scripts/DataContracts/Song/SongDetailsForApi.ts @@ -80,9 +80,7 @@ export class SongDetailsForApi { ) { this.additionalNames = contract.additionalNames; this.albums = contract.albums; - this.alternateVersions = contract.alternateVersions.filter( - (a) => a.songType !== SongType.Original, - ); + this.alternateVersions = contract.alternateVersions; this.artistString = contract.artistString; this.browsedAlbumId = contract.album?.id; this.canEditPersonalDescription = contract.canEditPersonalDescription; @@ -105,12 +103,7 @@ export class SongDetailsForApi { this.minMilliBpm = contract.minMilliBpm; this.name = contract.song.name; this.notes = contract.notes; - - this.originalVersion = - contract.song.songType !== SongType.Original - ? contract.originalVersion - : undefined; - + this.originalVersion = contract.originalVersion; this.personalDescriptionAuthor = contract.personalDescriptionAuthor; this.personalDescriptionText = contract.personalDescriptionText; this.pools = contract.pools; diff --git a/VocaDbWeb/Scripts/Stores/Song/SongCreateStore.ts b/VocaDbWeb/Scripts/Stores/Song/SongCreateStore.ts index 9b1ae9815b..0065367b88 100644 --- a/VocaDbWeb/Scripts/Stores/Song/SongCreateStore.ts +++ b/VocaDbWeb/Scripts/Stores/Song/SongCreateStore.ts @@ -78,6 +78,8 @@ export class SongCreateStore { } @computed get canHaveOriginalVersion(): boolean { + // Having a original/base version for an original song is uncommon. + // Hide the base version selector as that's more suited for this simplified interface. return this.songType !== SongType.Original; } diff --git a/VocaDbWeb/Scripts/Stores/Song/SongDetailsStore.ts b/VocaDbWeb/Scripts/Stores/Song/SongDetailsStore.ts index 5dcf31ad53..1e958b67d5 100644 --- a/VocaDbWeb/Scripts/Stores/Song/SongDetailsStore.ts +++ b/VocaDbWeb/Scripts/Stores/Song/SongDetailsStore.ts @@ -308,7 +308,7 @@ export class SongDetailsStore { this.tagUsages = new TagListStore(data.tagUsages); - if (data.songType !== SongType.Original && !this.originalVersion.entry) { + if (!this.originalVersion.entry) { this.getOriginal(data.linkedPages); } } diff --git a/VocaDbWeb/Scripts/Stores/Song/SongEditStore.ts b/VocaDbWeb/Scripts/Stores/Song/SongEditStore.ts index ff5dd6c373..9db4e55dd0 100644 --- a/VocaDbWeb/Scripts/Stores/Song/SongEditStore.ts +++ b/VocaDbWeb/Scripts/Stores/Song/SongEditStore.ts @@ -185,7 +185,7 @@ export class SongEditStore { } @computed get canHaveOriginalVersion(): boolean { - return this.songType !== SongType.Original; + return true; } @computed get showInstrumentalNote(): boolean {