Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capture "musicbrainz_releasetrackid" tag (#1827)
* db/migration: typo fix * model: add MbzReleaseTrackID field * scanner: capture the musicbrainz_releasetrackid tag
- Loading branch information
Showing
6 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
db/migration/20220724231849_add_musicbrainz_release_track_id.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package migrations | ||
|
||
import ( | ||
"database/sql" | ||
|
||
"github.com/pressly/goose" | ||
) | ||
|
||
func init() { | ||
goose.AddMigration(upAddMusicbrainzReleaseTrackId, downAddMusicbrainzReleaseTrackId) | ||
} | ||
|
||
func upAddMusicbrainzReleaseTrackId(tx *sql.Tx) error { | ||
_, err := tx.Exec(` | ||
alter table media_file | ||
add mbz_release_track_id varchar(255); | ||
`) | ||
if err != nil { | ||
return err | ||
} | ||
notice(tx, "A full rescan needs to be performed to import more tags") | ||
return forceFullRescan(tx) | ||
} | ||
|
||
func downAddMusicbrainzReleaseTrackId(tx *sql.Tx) error { | ||
// This code is executed when the migration is rolled back. | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters