mirror of
https://github.com/Dummi26/musicdb.git
synced 2025-12-14 11:56:16 +01:00
albums must have an artist + some client gui_edit changes
This commit is contained in:
@@ -8,7 +8,7 @@ use super::{AlbumId, ArtistId, CoverId, GeneralData, SongId};
|
||||
pub struct Album {
|
||||
pub id: AlbumId,
|
||||
pub name: String,
|
||||
pub artist: Option<ArtistId>,
|
||||
pub artist: ArtistId,
|
||||
pub cover: Option<CoverId>,
|
||||
pub songs: Vec<SongId>,
|
||||
pub general: GeneralData,
|
||||
|
||||
@@ -121,7 +121,7 @@ impl Database {
|
||||
pub fn add_album_new(&mut self, album: Album) -> AlbumId {
|
||||
let artist = album.artist.clone();
|
||||
let id = self.add_album_new_nomagic(album);
|
||||
if let Some(Some(artist)) = artist.map(|v| self.artists.get_mut(&v)) {
|
||||
if let Some(artist) = self.artists.get_mut(&artist) {
|
||||
artist.albums.push(id);
|
||||
}
|
||||
id
|
||||
|
||||
Reference in New Issue
Block a user