fix: show artist covers (raw url in artist info, cover id elsewhere) via scanned guessed artist folder
closes #180 closes #179
This commit is contained in:
@@ -37,6 +37,7 @@ func (db *DB) Migrate(ctx MigrationContext) error {
|
||||
construct(ctx, "202102191448", migratePodcastAutoDownload),
|
||||
construct(ctx, "202110041330", migrateAlbumCreatedAt),
|
||||
construct(ctx, "202111021951", migrateAlbumRootDir),
|
||||
construct(ctx, "202201042236", migrateArtistGuessedFolder),
|
||||
}
|
||||
|
||||
return gormigrate.
|
||||
@@ -306,3 +307,7 @@ func migrateAlbumRootDir(tx *gorm.DB, ctx MigrationContext) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func migrateArtistGuessedFolder(tx *gorm.DB, ctx MigrationContext) error {
|
||||
return tx.AutoMigrate(Artist{}).Error
|
||||
}
|
||||
|
||||
@@ -43,11 +43,13 @@ func joinInt(in []int, sep string) string {
|
||||
}
|
||||
|
||||
type Artist struct {
|
||||
ID int `gorm:"primary_key"`
|
||||
Name string `gorm:"not null; unique_index"`
|
||||
NameUDec string `sql:"default: null"`
|
||||
Albums []*Album `gorm:"foreignkey:TagArtistID"`
|
||||
AlbumCount int `sql:"-"`
|
||||
ID int `gorm:"primary_key"`
|
||||
Name string `gorm:"not null; unique_index"`
|
||||
NameUDec string `sql:"default: null"`
|
||||
Albums []*Album `gorm:"foreignkey:TagArtistID"`
|
||||
AlbumCount int `sql:"-"`
|
||||
GuessedFolder *Album
|
||||
GuessedFolderID int `sql:"default: null; type:int REFERENCES albums(id)"`
|
||||
}
|
||||
|
||||
func (a *Artist) SID() *specid.ID {
|
||||
|
||||
Reference in New Issue
Block a user