mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-05 05:27:37 +03:00
Fix ReplayGain values not being retrieved from DB
This commit is contained in:
parent
814161d78d
commit
e50382e3bf
4 changed files with 18 additions and 14 deletions
|
@ -67,10 +67,10 @@ type MediaFile struct {
|
||||||
MbzAlbumArtistID string `structs:"mbz_album_artist_id" json:"mbzAlbumArtistId,omitempty"`
|
MbzAlbumArtistID string `structs:"mbz_album_artist_id" json:"mbzAlbumArtistId,omitempty"`
|
||||||
MbzAlbumType string `structs:"mbz_album_type" json:"mbzAlbumType,omitempty"`
|
MbzAlbumType string `structs:"mbz_album_type" json:"mbzAlbumType,omitempty"`
|
||||||
MbzAlbumComment string `structs:"mbz_album_comment" json:"mbzAlbumComment,omitempty"`
|
MbzAlbumComment string `structs:"mbz_album_comment" json:"mbzAlbumComment,omitempty"`
|
||||||
RGAlbumGain float64 `structs:"rg_album_gain" json:"rgAlbumGain"`
|
RgAlbumGain float64 `structs:"rg_album_gain" json:"rgAlbumGain"`
|
||||||
RGAlbumPeak float64 `structs:"rg_album_peak" json:"rgAlbumPeak"`
|
RgAlbumPeak float64 `structs:"rg_album_peak" json:"rgAlbumPeak"`
|
||||||
RGTrackGain float64 `structs:"rg_track_gain" json:"rgTrackGain"`
|
RgTrackGain float64 `structs:"rg_track_gain" json:"rgTrackGain"`
|
||||||
RGTrackPeak float64 `structs:"rg_track_peak" json:"rgTrackPeak"`
|
RgTrackPeak float64 `structs:"rg_track_peak" json:"rgTrackPeak"`
|
||||||
|
|
||||||
CreatedAt time.Time `structs:"created_at" json:"createdAt"` // Time this entry was created in the DB
|
CreatedAt time.Time `structs:"created_at" json:"createdAt"` // Time this entry was created in the DB
|
||||||
UpdatedAt time.Time `structs:"updated_at" json:"updatedAt"` // Time of file last update (mtime)
|
UpdatedAt time.Time `structs:"updated_at" json:"updatedAt"` // Time of file last update (mtime)
|
||||||
|
|
|
@ -63,7 +63,11 @@ var (
|
||||||
songDayInALife = model.MediaFile{ID: "1001", Title: "A Day In A Life", ArtistID: "3", Artist: "The Beatles", AlbumID: "101", Album: "Sgt Peppers", Genre: "Rock", Genres: model.Genres{genreRock}, Path: P("/beatles/1/sgt/a day.mp3"), FullText: " a beatles day in life peppers sgt the"}
|
songDayInALife = model.MediaFile{ID: "1001", Title: "A Day In A Life", ArtistID: "3", Artist: "The Beatles", AlbumID: "101", Album: "Sgt Peppers", Genre: "Rock", Genres: model.Genres{genreRock}, Path: P("/beatles/1/sgt/a day.mp3"), FullText: " a beatles day in life peppers sgt the"}
|
||||||
songComeTogether = model.MediaFile{ID: "1002", Title: "Come Together", ArtistID: "3", Artist: "The Beatles", AlbumID: "102", Album: "Abbey Road", Genre: "Rock", Genres: model.Genres{genreRock}, Path: P("/beatles/1/come together.mp3"), FullText: " abbey beatles come road the together"}
|
songComeTogether = model.MediaFile{ID: "1002", Title: "Come Together", ArtistID: "3", Artist: "The Beatles", AlbumID: "102", Album: "Abbey Road", Genre: "Rock", Genres: model.Genres{genreRock}, Path: P("/beatles/1/come together.mp3"), FullText: " abbey beatles come road the together"}
|
||||||
songRadioactivity = model.MediaFile{ID: "1003", Title: "Radioactivity", ArtistID: "2", Artist: "Kraftwerk", AlbumID: "103", Album: "Radioactivity", Genre: "Electronic", Genres: model.Genres{genreElectronic}, Path: P("/kraft/radio/radio.mp3"), FullText: " kraftwerk radioactivity"}
|
songRadioactivity = model.MediaFile{ID: "1003", Title: "Radioactivity", ArtistID: "2", Artist: "Kraftwerk", AlbumID: "103", Album: "Radioactivity", Genre: "Electronic", Genres: model.Genres{genreElectronic}, Path: P("/kraft/radio/radio.mp3"), FullText: " kraftwerk radioactivity"}
|
||||||
songAntenna = model.MediaFile{ID: "1004", Title: "Antenna", ArtistID: "2", Artist: "Kraftwerk", AlbumID: "103", Genre: "Electronic", Genres: model.Genres{genreElectronic, genreRock}, Path: P("/kraft/radio/antenna.mp3"), FullText: " antenna kraftwerk"}
|
songAntenna = model.MediaFile{ID: "1004", Title: "Antenna", ArtistID: "2", Artist: "Kraftwerk",
|
||||||
|
AlbumID: "103", Genre: "Electronic", Genres: model.Genres{genreElectronic, genreRock},
|
||||||
|
Path: P("/kraft/radio/antenna.mp3"), FullText: " antenna kraftwerk",
|
||||||
|
RgAlbumGain: 1.0, RgAlbumPeak: 2.0, RgTrackGain: 3.0, RgTrackPeak: 4.0,
|
||||||
|
}
|
||||||
testSongs = model.MediaFiles{
|
testSongs = model.MediaFiles{
|
||||||
songDayInALife,
|
songDayInALife,
|
||||||
songComeTogether,
|
songComeTogether,
|
||||||
|
|
|
@ -68,10 +68,10 @@ func (s MediaFileMapper) ToMediaFile(md metadata.Tags) model.MediaFile {
|
||||||
mf.MbzAlbumArtistID = md.MbzAlbumArtistID()
|
mf.MbzAlbumArtistID = md.MbzAlbumArtistID()
|
||||||
mf.MbzAlbumType = md.MbzAlbumType()
|
mf.MbzAlbumType = md.MbzAlbumType()
|
||||||
mf.MbzAlbumComment = md.MbzAlbumComment()
|
mf.MbzAlbumComment = md.MbzAlbumComment()
|
||||||
mf.RGAlbumGain = md.RGAlbumGain()
|
mf.RgAlbumGain = md.RGAlbumGain()
|
||||||
mf.RGAlbumPeak = md.RGAlbumPeak()
|
mf.RgAlbumPeak = md.RGAlbumPeak()
|
||||||
mf.RGTrackGain = md.RGTrackGain()
|
mf.RgTrackGain = md.RGTrackGain()
|
||||||
mf.RGTrackPeak = md.RGTrackPeak()
|
mf.RgTrackPeak = md.RGTrackPeak()
|
||||||
mf.Comment = utils.SanitizeText(md.Comment())
|
mf.Comment = utils.SanitizeText(md.Comment())
|
||||||
mf.Lyrics = md.Lyrics()
|
mf.Lyrics = md.Lyrics()
|
||||||
mf.Bpm = md.Bpm()
|
mf.Bpm = md.Bpm()
|
||||||
|
|
|
@ -178,10 +178,10 @@ func childFromMediaFile(ctx context.Context, mf model.MediaFile) responses.Child
|
||||||
child.MediaType = responses.MediaTypeSong
|
child.MediaType = responses.MediaTypeSong
|
||||||
child.MusicBrainzId = mf.MbzRecordingID
|
child.MusicBrainzId = mf.MbzRecordingID
|
||||||
child.ReplayGain = responses.ReplayGain{
|
child.ReplayGain = responses.ReplayGain{
|
||||||
TrackGain: mf.RGTrackGain,
|
TrackGain: mf.RgTrackGain,
|
||||||
AlbumGain: mf.RGAlbumGain,
|
AlbumGain: mf.RgAlbumGain,
|
||||||
TrackPeak: mf.RGTrackPeak,
|
TrackPeak: mf.RgTrackPeak,
|
||||||
AlbumPeak: mf.RGAlbumPeak,
|
AlbumPeak: mf.RgAlbumPeak,
|
||||||
}
|
}
|
||||||
return child
|
return child
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue