music: add demo release type
This is part of the MusicBrainz spec, but I didn't think of implementing it. Turns out it's stupidly common among music releases, so may as well. Resolves #590.
This commit is contained in:
@@ -607,6 +607,7 @@ constructor(
|
||||
is ReleaseType.Soundtrack -> AlbumGrouping.SOUNDTRACKS
|
||||
is ReleaseType.Mix -> AlbumGrouping.DJMIXES
|
||||
is ReleaseType.Mixtape -> AlbumGrouping.MIXTAPES
|
||||
is ReleaseType.Demo -> AlbumGrouping.DEMOS
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -709,6 +710,7 @@ constructor(
|
||||
SOUNDTRACKS(R.string.lbl_soundtracks),
|
||||
DJMIXES(R.string.lbl_mixes),
|
||||
MIXTAPES(R.string.lbl_mixtapes),
|
||||
DEMOS(R.string.lbl_demos),
|
||||
APPEARANCES(R.string.lbl_appears_on),
|
||||
LIVE(R.string.lbl_live_group),
|
||||
REMIXES(R.string.lbl_remix_group),
|
||||
|
||||
@@ -143,6 +143,18 @@ sealed interface ReleaseType {
|
||||
get() = R.string.lbl_mixtape
|
||||
}
|
||||
|
||||
/**
|
||||
* A demo. These are usually [EP]-sized releases of music made to promote an Artist or a future
|
||||
* release.
|
||||
*/
|
||||
data object Demo : ReleaseType {
|
||||
override val refinement: Refinement?
|
||||
get() = null
|
||||
|
||||
override val stringRes: Int
|
||||
get() = R.string.lbl_demo
|
||||
}
|
||||
|
||||
/** A specification of what kind of performance a particular release is. */
|
||||
enum class Refinement {
|
||||
/** A release consisting of a live performance */
|
||||
@@ -220,6 +232,7 @@ sealed interface ReleaseType {
|
||||
type.equals("dj-mix", true) -> Mix
|
||||
type.equals("live", true) -> convertRefinement(Refinement.LIVE)
|
||||
type.equals("remix", true) -> convertRefinement(Refinement.REMIX)
|
||||
type.equals("demo", true) -> Demo
|
||||
else -> convertRefinement(null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@
|
||||
<string name="lbl_mixtapes">Mixtapes</string>
|
||||
<!-- As in the collection of music -->
|
||||
<string name="lbl_mixtape">Mixtape</string>
|
||||
<!-- As in the collection of music -->
|
||||
<string name="lbl_demo">Demo</string>
|
||||
<!-- AS in the collection of music -->
|
||||
<string name="lbl_demos">Demos</string>
|
||||
<!-- As in a compilation of several performances that blend into a single continuous flow of music (Also known as DJ Mixes) -->
|
||||
<string name="lbl_mixes">DJ Mixes</string>
|
||||
<!-- As in a compilation of several performances that blend into a single continuous flow of music (Also known as DJ Mixes) -->
|
||||
|
||||
Reference in New Issue
Block a user