lydavid / MusicSearch

An Android app for browsing songs, artists, and anything related to them
https://lydavid.github.io/MusicSearch/
Apache License 2.0
54 stars 1 forks source link

begin area, area, end area #1064

Closed github-actions[bot] closed 1 month ago

github-actions[bot] commented 3 months ago

countryCode?.ifNotNullOrEmpty {

TextWithHeadingRes(headingRes \= strings.area, text \= it.toFlagEmoji())

}

https://github.com/lydavid/MusicSearch/blob/97c5fb8b0bd647bcd0e6edb768d2ef906e0b8a87/shared/feature/details/src/commonMain/kotlin/ly/david/musicsearch/shared/feature/details/artist/ArtistDetailsUi.kt#L102


        }
    }
}

@Composable
private fun ArtistDetailsModel.ArtistInformationSection(
    filterText: String = "",
) {
    val strings = LocalStrings.current

    ListSeparatorHeader(text = strings.informationHeader(strings.artist))
    sortName.ifNotNullOrEmpty {
        TextWithHeading(
            heading = strings.sortName,
            text = it,
            filterText = filterText,
        )
    }
    type?.ifNotNullOrEmpty {
        TextWithHeading(
            heading = strings.type,
            text = it,
            filterText = filterText,
        )
    }
    gender?.ifNotNullOrEmpty {
        TextWithHeading(
            heading = strings.gender,
            text = it,
            filterText = filterText,
        )
    }
    LifeSpanText(
        lifeSpan = lifeSpan,
        heading = strings.date,
        beginHeading = when (type) {
            "Person" -> strings.born
            "Character" -> strings.created
            else -> strings.founded
        },
        endHeading = when (type) {
            "Person" -> strings.died
            // Characters do not "die": https://musicbrainz.org/doc/Artist
            else -> strings.dissolved
        },
        filterText = filterText,
    )

    // TODO: begin area, area, end area
//                countryCode?.ifNotNullOrEmpty {
//                    TextWithHeadingRes(headingRes = strings.area, text = it.toFlagEmoji())
//                }

    // TODO: isni code

    // todo: ipis code

    WikipediaSection(
        extract = wikipediaExtract,
        filterText = filterText,
    )

    Spacer(modifier = Modifier.padding(bottom = 16.dp))
}
lydavid commented 2 months ago

https://github.com/metabrainz/musicbrainz-server/blob/master/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Artist.pm#L21-L24

https://github.com/metabrainz/musicbrainz-server/blob/master/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Area.pm#L14-L16

lydavid commented 1 month ago

Although I could use the countryCode, I would not have its id to link into. So, I should insert the area if it doesn't exist, and a link between the artist and area. Even better if I reuse artists_by_entity

lydavid commented 1 month ago

when we insert the artist's area, it does not have a type

    "area": {
        "iso-3166-1-codes": ["JP"],
        "name": "Japan",
        "type": null,
        "id": "2db42837-c832-3c27-b4a3-08198f75693c",
        "disambiguation": "",
        "sort-name": "Japan",
        "type-id": null
    },
lydavid commented 1 month ago

begin-area, area, end-area can all be different. do we need a linking table area_artist?

area can go in artists_by_entity

lydavid commented 1 month ago

an artist's area can have iso-3166-2-codes, so it's not just countries

    "area": {
        "name": "England",
        "iso-3166-2-codes": ["GB-ENG"],
        "type-id": null,
        "sort-name": "England",
        "type": null,
        "id": "9d5dd675-3cf4-4296-9e39-67865ebee758",
        "disambiguation": ""
    },