Skip to content

Commit e940aca

Browse files
fix: STUD-483 - Release title not updating on song title update
1 parent 829ca48 commit e940aca

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

newm-chain-grpc/build.gradle.kts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,34 @@ protobuf {
7979
}
8080
}
8181

82+
// work-around for protobuf plugin not registering generated sources properly.
83+
sourceSets {
84+
main {
85+
java {
86+
srcDirs(
87+
"build/generated/source/proto/main/java",
88+
"build/generated/source/proto/main/grpc",
89+
)
90+
}
91+
kotlin {
92+
srcDirs(
93+
"build/generated/source/proto/main/kotlin",
94+
"build/generated/source/proto/main/grpckt",
95+
)
96+
}
97+
}
98+
}
99+
afterEvaluate {
100+
tasks {
101+
// Ensure that generated sources are done before including them in the sources jar
102+
named<Jar>("sourcesJar") {
103+
archiveClassifier.set("sources")
104+
from(sourceSets.main.get().allSource)
105+
dependsOn("generateProto")
106+
}
107+
}
108+
}
109+
82110
signing {
83111
useGpgCmd()
84112
}

newm-server/src/main/kotlin/io/newm/server/features/song/repo/SongRepositoryImpl.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ internal class SongRepositoryImpl(
221221
it.checkTitleUnique(songEntity.ownerId.value, songEntity.mintingStatus)
222222
}
223223
songEntity.title = it
224+
// We're assuming this is a single, so we also update the release title to match the song title.
225+
releaseEntity.title = it
224226
}
225227
genres?.let { songEntity.genres = it }
226228
moods?.let { songEntity.moods = it }

newm-server/src/test/kotlin/io/newm/server/features/song/SongRoutesTests.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,9 @@ class SongRoutesTests : BaseApplicationTests() {
855855
assertThat(song2.audioEncodingStatus).isEqualTo(AudioEncodingStatus.NotStarted)
856856
assertThat(song2.mintingStatus).isEqualTo(MintingStatus.Undistributed)
857857
assertThat(song2.marketplaceStatus).isEqualTo(MarketplaceStatus.NotSelling)
858+
859+
val release = transaction { ReleaseEntity[song2.releaseId!!].toModel() }
860+
assertThat(release.title).isEqualTo(testSong2.title)
858861
}
859862

860863
@Test

0 commit comments

Comments
 (0)