move from dhowden/tag to mdlayher/taggolib

This commit is contained in:
sentriz
2019-06-06 15:15:38 +01:00
parent 2a644aa723
commit 63f8889660
8 changed files with 87 additions and 59 deletions

View File

@@ -48,7 +48,8 @@ func newTCTrackByFolder(t *model.Track, parent *model.Album) *subsonic.TrackChil
),
ParentID: parent.ID,
CoverID: parent.ID,
Duration: 0,
Duration: t.Duration,
Bitrate: t.Bitrate,
IsDir: false,
Type: "music",
}

View File

@@ -41,6 +41,8 @@ func newTrackByTags(t *model.Track, album *model.Album) *subsonic.TrackChild {
AlbumID: album.ID,
ArtistID: album.TagArtist.ID,
CoverID: album.ID,
Duration: t.Duration,
Bitrate: t.Bitrate,
Type: "music",
}
}

View File

@@ -78,7 +78,7 @@ func (c *Controller) GetCoverArt(w http.ResponseWriter, r *http.Request) {
}
folder := &model.Album{}
err = c.DB.
Select("id, path, cover").
Select("id, left_path, right_path, cover").
First(folder, id).
Error
if gorm.IsRecordNotFoundError(err) {
@@ -91,8 +91,8 @@ func (c *Controller) GetCoverArt(w http.ResponseWriter, r *http.Request) {
}
absPath := path.Join(
c.MusicPath,
folder.RightPath,
folder.LeftPath,
folder.RightPath,
folder.Cover,
)
http.ServeFile(w, r, absPath)