Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
094ab2e458
|
||
|
|
f79af9c6a8
|
||
|
|
8df5f95a3d
|
||
|
|
3c46097df3
|
||
|
|
13098660d2
|
||
|
|
fb3fb745f8
|
||
|
|
ee43c4db00
|
||
|
|
da5f2ca01c
|
||
|
|
e4a07750e4
|
||
|
|
d42ce531c6
|
||
|
|
88edd8b546
|
||
|
|
192ee10b3f | ||
|
|
9473ec7539 | ||
|
|
1b770c95d8 | ||
|
|
798e7f875a | ||
|
|
65c4674da0 | ||
|
|
e535e7888c | ||
|
|
ad65a9ab3e | ||
|
|
5e916d0f4c | ||
|
|
b2674f8e5a |
No files matched your search
@@ -24,7 +24,7 @@
|
|||||||
- support for the [album-artist](https://mkoby.com/2007/02/18/artist-versus-album-artist/) tag, to not clutter your artist list with compilation album appearances
|
- support for the [album-artist](https://mkoby.com/2007/02/18/artist-versus-album-artist/) tag, to not clutter your artist list with compilation album appearances
|
||||||
- written in [go](https://golang.org/), so lightweight and suitable for a raspberry pi, etc. (see ARM images below)
|
- written in [go](https://golang.org/), so lightweight and suitable for a raspberry pi, etc. (see ARM images below)
|
||||||
- newer salt and token auth
|
- newer salt and token auth
|
||||||
- tested on [airsonic-refix](https://github.com/tamland/airsonic-refix), [symfonium](https://symfonium.app), [dsub](https://f-droid.org/en/packages/github.daneren2005.dsub/), [jamstash](http://jamstash.com/), [subsonic.el](https://git.sr.ht/~amk/subsonic.el), [sublime music](https://github.com/sublime-music/sublime-music), [soundwaves](https://apps.apple.com/us/app/soundwaves/id736139596), [stmp](https://github.com/wildeyedskies/stmp), [termsonic](https://git.sixfoisneuf.fr/termsonic/), [tempus](https://github.com/eddyizm/tempus/), [strawberry](https://www.strawberrymusicplayer.org/), and [ultrasonic](https://gitlab.com/ultrasonic/ultrasonic)
|
- tested on [airsonic-refix](https://github.com/tamland/airsonic-refix), [amperfy](https://github.com/BLeeEZ/amperfy), [symfonium](https://symfonium.app), [dsub](https://f-droid.org/en/packages/github.daneren2005.dsub/), [jamstash](https://github.com/sqrlmstr5000/Jamstash), [subsonic.el](https://git.sr.ht/~amk/subsonic.el), [sublime music](https://github.com/sublime-music/sublime-music), [soundwaves](https://apps.apple.com/us/app/soundwaves/id736139596), [stmp](https://github.com/wildeyedskies/stmp), [termsonic](https://git.sixfoisneuf.fr/termsonic/), [tempus](https://github.com/eddyizm/tempus/), [strawberry](https://www.strawberrymusicplayer.org/), and [ultrasonic](https://gitlab.com/ultrasonic/ultrasonic)
|
||||||
|
|
||||||
## installation
|
## installation
|
||||||
|
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ type Track struct {
|
|||||||
TagDiscNumber int `sql:"default: null"`
|
TagDiscNumber int `sql:"default: null"`
|
||||||
TagBrainzID string `sql:"default: null"`
|
TagBrainzID string `sql:"default: null"`
|
||||||
TagLyrics string `sql:"default: null"`
|
TagLyrics string `sql:"default: null"`
|
||||||
|
TagYear int `sql:"default: null"`
|
||||||
|
|
||||||
ReplayGainTrackGain float32
|
ReplayGainTrackGain float32
|
||||||
ReplayGainTrackPeak float32
|
ReplayGainTrackPeak float32
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ func (db *DB) Migrate(ctx MigrationContext) error {
|
|||||||
construct(ctx, "202509301448", migrateAddTrackEmbeddedCover),
|
construct(ctx, "202509301448", migrateAddTrackEmbeddedCover),
|
||||||
construct(ctx, "202512021147", migrateAlbumAddIndexOnCreatedAt),
|
construct(ctx, "202512021147", migrateAlbumAddIndexOnCreatedAt),
|
||||||
construct(ctx, "202601201000", migrateAddAlbumDiscTitles),
|
construct(ctx, "202601201000", migrateAddAlbumDiscTitles),
|
||||||
|
construct(ctx, "202602061800", migrateAddTrackYear),
|
||||||
}
|
}
|
||||||
|
|
||||||
return gormigrate.
|
return gormigrate.
|
||||||
@@ -879,3 +880,22 @@ func migrateAlbumAddIndexOnCreatedAt(tx *gorm.DB, _ MigrationContext) error {
|
|||||||
func migrateAddAlbumDiscTitles(tx *gorm.DB, _ MigrationContext) error {
|
func migrateAddAlbumDiscTitles(tx *gorm.DB, _ MigrationContext) error {
|
||||||
return tx.AutoMigrate(AlbumDiscTitle{}).Error
|
return tx.AutoMigrate(AlbumDiscTitle{}).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func migrateAddTrackYear(tx *gorm.DB, _ MigrationContext) error {
|
||||||
|
step := tx.AutoMigrate(Track{})
|
||||||
|
if err := step.Error; err != nil {
|
||||||
|
return fmt.Errorf("step auto migrate: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
step = tx.Exec(`
|
||||||
|
UPDATE tracks
|
||||||
|
SET tag_year=(SELECT tag_year
|
||||||
|
FROM albums
|
||||||
|
WHERE tracks.album_id = albums.id)
|
||||||
|
`)
|
||||||
|
if err := step.Error; err != nil {
|
||||||
|
return fmt.Errorf("step set default track year based on album's : %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package listenbrainz
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/tls"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -30,11 +31,15 @@ type Client struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewClient() *Client {
|
func NewClient() *Client {
|
||||||
// disable keep-alive to avoid "connection reset by peer" errors caused by a race between
|
// disable post-quantum key exchange (Kyber) to avoid "connection reset by peer" errors.
|
||||||
// the server closing idle connections and the client reusing them for new requests
|
// listenbrainz's server can't handle the larger TLS ClientHello
|
||||||
|
// https://github.com/golang/go/issues/70139
|
||||||
return NewClientCustom(&http.Client{
|
return NewClientCustom(&http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
DisableKeepAlives: true,
|
TLSClientConfig: &tls.Config{
|
||||||
|
MinVersion: tls.VersionTLS12,
|
||||||
|
CurvePreferences: []tls.CurveID{tls.X25519, tls.CurveP256, tls.CurveP384},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,6 +134,9 @@ func (s *Store) Read(relPath string) (*Playlist, error) {
|
|||||||
if strings.HasPrefix(line, "#") {
|
if strings.HasPrefix(line, "#") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if !filepath.IsAbs(line) {
|
||||||
|
line = filepath.Join(filepath.Dir(absPath), line)
|
||||||
|
}
|
||||||
playlist.Items = append(playlist.Items, line)
|
playlist.Items = append(playlist.Items, line)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,6 +189,9 @@ func (s *Store) Write(relPath string, playlist *Playlist) error {
|
|||||||
fmt.Fprintln(file, encodeAttr(attrCommment, playlist.Comment))
|
fmt.Fprintln(file, encodeAttr(attrCommment, playlist.Comment))
|
||||||
fmt.Fprintln(file, encodeAttr(attrIsPublic, fmt.Sprint(playlist.IsPublic)))
|
fmt.Fprintln(file, encodeAttr(attrIsPublic, fmt.Sprint(playlist.IsPublic)))
|
||||||
for _, line := range playlist.Items {
|
for _, line := range playlist.Items {
|
||||||
|
if rel, err := filepath.Rel(filepath.Dir(absPath), line); err == nil {
|
||||||
|
line = rel
|
||||||
|
}
|
||||||
fmt.Fprintln(file, line)
|
fmt.Fprintln(file, line)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ Example comment
|
|||||||
It has multiple lines 👍
|
It has multiple lines 👍
|
||||||
`,
|
`,
|
||||||
Items: []string{
|
Items: []string{
|
||||||
"item 1.flac",
|
"/music/item 1.flac",
|
||||||
"item 2.flac",
|
"/music/item 2.flac",
|
||||||
"item 3.flac",
|
"/music/item 3.flac",
|
||||||
},
|
},
|
||||||
IsPublic: true,
|
IsPublic: true,
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-9
@@ -81,13 +81,17 @@ func (p *Podcasts) AddNewPodcast(rssURL string, feed *gofeed.Feed) (*db.Podcast,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("find unique podcast dir: %w", err)
|
return nil, fmt.Errorf("find unique podcast dir: %w", err)
|
||||||
}
|
}
|
||||||
|
var author string
|
||||||
|
if feed.ITunesExt != nil {
|
||||||
|
author = feed.ITunesExt.Author
|
||||||
|
}
|
||||||
podcast := db.Podcast{
|
podcast := db.Podcast{
|
||||||
Description: feed.Description,
|
Description: feed.Description,
|
||||||
ImageURL: "",
|
ImageURL: "",
|
||||||
Title: feed.Title,
|
Title: feed.Title,
|
||||||
URL: rssURL,
|
URL: rssURL,
|
||||||
RootDir: rootDir,
|
RootDir: rootDir,
|
||||||
Author: feed.ITunesExt.Author,
|
Author: author,
|
||||||
}
|
}
|
||||||
if feed.Image != nil {
|
if feed.Image != nil {
|
||||||
podcast.ImageURL = feed.Image.URL
|
podcast.ImageURL = feed.Image.URL
|
||||||
@@ -226,6 +230,10 @@ func (p *Podcasts) isAudio(rawItemURL string) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func itemToEpisode(podcast *db.Podcast, size, duration int, audio string, item *gofeed.Item) *db.PodcastEpisode {
|
func itemToEpisode(podcast *db.Podcast, size, duration int, audio string, item *gofeed.Item) *db.PodcastEpisode {
|
||||||
|
author := podcast.Author
|
||||||
|
if item.ITunesExt != nil {
|
||||||
|
author = cmp.Or(item.ITunesExt.Author, podcast.Author)
|
||||||
|
}
|
||||||
return &db.PodcastEpisode{
|
return &db.PodcastEpisode{
|
||||||
PodcastID: podcast.ID,
|
PodcastID: podcast.ID,
|
||||||
Description: item.Description,
|
Description: item.Description,
|
||||||
@@ -235,7 +243,7 @@ func itemToEpisode(podcast *db.Podcast, size, duration int, audio string, item *
|
|||||||
PublishDate: item.PublishedParsed,
|
PublishDate: item.PublishedParsed,
|
||||||
AudioURL: audio,
|
AudioURL: audio,
|
||||||
Status: db.PodcastEpisodeStatusSkipped,
|
Status: db.PodcastEpisodeStatusSkipped,
|
||||||
Artist: cmp.Or(item.ITunesExt.Author, podcast.Author),
|
Artist: cmp.Or(author),
|
||||||
Album: podcast.Title,
|
Album: podcast.Title,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -508,6 +516,13 @@ func (p *Podcasts) doPodcastDownload(podcast *db.Podcast, podcastEpisode *db.Pod
|
|||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
if err != nil {
|
||||||
|
podcastEpisode.Status = db.PodcastEpisodeStatusError
|
||||||
|
_ = p.db.Save(podcastEpisode).Error
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if resp.StatusCode/100 != 2 {
|
if resp.StatusCode/100 != 2 {
|
||||||
return fmt.Errorf("fetch podcast audio: unexpected status %s", resp.Status)
|
return fmt.Errorf("fetch podcast audio: unexpected status %s", resp.Status)
|
||||||
}
|
}
|
||||||
@@ -529,13 +544,6 @@ func (p *Podcasts) doPodcastDownload(podcast *db.Podcast, podcastEpisode *db.Pod
|
|||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
defer func() {
|
|
||||||
if err != nil {
|
|
||||||
podcastEpisode.Status = db.PodcastEpisodeStatusError
|
|
||||||
_ = p.db.Save(podcastEpisode).Error
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
if _, err := io.Copy(file, resp.Body); err != nil {
|
if _, err := io.Copy(file, resp.Body); err != nil {
|
||||||
return fmt.Errorf("writing podcast episode: %w", err)
|
return fmt.Errorf("writing podcast episode: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ func (s *Scanner) ExecuteWatch(ctx context.Context) error {
|
|||||||
case event := <-watcher.Events:
|
case event := <-watcher.Events:
|
||||||
if event.Op&(fsnotify.Remove) == fsnotify.Remove {
|
if event.Op&(fsnotify.Remove) == fsnotify.Remove {
|
||||||
batchClean = true
|
batchClean = true
|
||||||
|
batchT.Reset(batchInterval)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if event.Op&(fsnotify.Create|fsnotify.Write) == 0 {
|
if event.Op&(fsnotify.Create|fsnotify.Write) == 0 {
|
||||||
@@ -569,6 +570,7 @@ func populateTrack(tx *db.DB, scanEmbeddedCover bool, album *db.Album, track *db
|
|||||||
track.TagTrackNumber = tags.ParseInt(normtag.Get(trags, normtag.TrackNumber))
|
track.TagTrackNumber = tags.ParseInt(normtag.Get(trags, normtag.TrackNumber))
|
||||||
track.TagDiscNumber = tags.ParseInt(normtag.Get(trags, normtag.DiscNumber))
|
track.TagDiscNumber = tags.ParseInt(normtag.Get(trags, normtag.DiscNumber))
|
||||||
track.TagBrainzID = normtag.Get(trags, normtag.MusicBrainzRecordingID)
|
track.TagBrainzID = normtag.Get(trags, normtag.MusicBrainzRecordingID)
|
||||||
|
track.TagYear = tags.MustYear(trags)
|
||||||
|
|
||||||
track.ReplayGainTrackGain = tags.ParseDB(normtag.Get(trags, normtag.ReplayGainTrackGain))
|
track.ReplayGainTrackGain = tags.ParseDB(normtag.Get(trags, normtag.ReplayGainTrackGain))
|
||||||
track.ReplayGainTrackPeak = tags.ParseFloat(normtag.Get(trags, normtag.ReplayGainTrackPeak))
|
track.ReplayGainTrackPeak = tags.ParseFloat(normtag.Get(trags, normtag.ReplayGainTrackPeak))
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ func (c *Controller) ServeScrobble(r *http.Request) *spec.Response {
|
|||||||
return spec.NewError(0, "error updating stats: %v", err)
|
return spec.NewError(0, "error updating stats: %v", err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return spec.NewError(10, "can't scrobble type %s", id.Type)
|
return spec.NewError(0, "can't scrobble type %s", id.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
if scrobbleTrack.Track == "" {
|
if scrobbleTrack.Track == "" {
|
||||||
|
|||||||
@@ -14,11 +14,14 @@ import (
|
|||||||
func (c *Controller) ServeGetPodcasts(r *http.Request) *spec.Response {
|
func (c *Controller) ServeGetPodcasts(r *http.Request) *spec.Response {
|
||||||
params := r.Context().Value(CtxParams).(params.Params)
|
params := r.Context().Value(CtxParams).(params.Params)
|
||||||
isIncludeEpisodes := params.GetOrBool("includeEpisodes", true)
|
isIncludeEpisodes := params.GetOrBool("includeEpisodes", true)
|
||||||
id, _ := params.GetID("id")
|
id, err := params.GetID("id")
|
||||||
podcasts, err := c.podcasts.GetPodcastOrAll(id.Value, isIncludeEpisodes)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return spec.NewError(10, "failed get podcast(s): %s", err)
|
return spec.NewError(10, "failed get podcast(s): %s", err)
|
||||||
}
|
}
|
||||||
|
podcasts, err := c.podcasts.GetPodcastOrAll(id.Value, isIncludeEpisodes)
|
||||||
|
if err != nil {
|
||||||
|
return spec.NewError(70, "failed get podcast(s): %s", err)
|
||||||
|
}
|
||||||
sub := spec.NewResponse()
|
sub := spec.NewResponse()
|
||||||
sub.Podcasts = &spec.Podcasts{}
|
sub.Podcasts = &spec.Podcasts{}
|
||||||
for _, podcast := range podcasts {
|
for _, podcast := range podcasts {
|
||||||
@@ -33,7 +36,7 @@ func (c *Controller) ServeGetNewestPodcasts(r *http.Request) *spec.Response {
|
|||||||
count := params.GetOrInt("count", 10)
|
count := params.GetOrInt("count", 10)
|
||||||
episodes, err := c.podcasts.GetNewestPodcastEpisodes(count)
|
episodes, err := c.podcasts.GetNewestPodcastEpisodes(count)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return spec.NewError(10, "failed get podcast(s): %s", err)
|
return spec.NewError(0, "failed get podcast(s): %s", err)
|
||||||
}
|
}
|
||||||
sub := spec.NewResponse()
|
sub := spec.NewResponse()
|
||||||
sub.NewestPodcasts = &spec.NewestPodcasts{}
|
sub.NewestPodcasts = &spec.NewestPodcasts{}
|
||||||
@@ -50,7 +53,7 @@ func (c *Controller) ServeDownloadPodcastEpisode(r *http.Request) *spec.Response
|
|||||||
return spec.NewError(10, "please provide a valid podcast episode id")
|
return spec.NewError(10, "please provide a valid podcast episode id")
|
||||||
}
|
}
|
||||||
if err := c.podcasts.DownloadEpisode(id.Value); err != nil {
|
if err := c.podcasts.DownloadEpisode(id.Value); err != nil {
|
||||||
return spec.NewError(10, "failed to download episode: %s", err)
|
return spec.NewError(0, "failed to download episode: %s", err)
|
||||||
}
|
}
|
||||||
return spec.NewResponse()
|
return spec.NewResponse()
|
||||||
}
|
}
|
||||||
@@ -65,10 +68,10 @@ func (c *Controller) ServeCreatePodcastChannel(r *http.Request) *spec.Response {
|
|||||||
fp := gofeed.NewParser()
|
fp := gofeed.NewParser()
|
||||||
feed, err := fp.ParseURL(rssURL)
|
feed, err := fp.ParseURL(rssURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return spec.NewError(10, "failed to parse feed: %s", err)
|
return spec.NewError(0, "failed to parse feed: %s", err)
|
||||||
}
|
}
|
||||||
if _, err = c.podcasts.AddNewPodcast(rssURL, feed); err != nil {
|
if _, err = c.podcasts.AddNewPodcast(rssURL, feed); err != nil {
|
||||||
return spec.NewError(10, "failed to add feed: %s", err)
|
return spec.NewError(0, "failed to add feed: %s", err)
|
||||||
}
|
}
|
||||||
return spec.NewResponse()
|
return spec.NewResponse()
|
||||||
}
|
}
|
||||||
@@ -79,7 +82,7 @@ func (c *Controller) ServeRefreshPodcasts(r *http.Request) *spec.Response {
|
|||||||
return spec.NewError(50, "user not admin")
|
return spec.NewError(50, "user not admin")
|
||||||
}
|
}
|
||||||
if err := c.podcasts.RefreshPodcasts(); err != nil {
|
if err := c.podcasts.RefreshPodcasts(); err != nil {
|
||||||
return spec.NewError(10, "failed to refresh feeds: %s", err)
|
return spec.NewError(0, "failed to refresh feeds: %s", err)
|
||||||
}
|
}
|
||||||
return spec.NewResponse()
|
return spec.NewResponse()
|
||||||
}
|
}
|
||||||
@@ -95,7 +98,7 @@ func (c *Controller) ServeDeletePodcastChannel(r *http.Request) *spec.Response {
|
|||||||
return spec.NewError(10, "please provide a valid podcast id")
|
return spec.NewError(10, "please provide a valid podcast id")
|
||||||
}
|
}
|
||||||
if err := c.podcasts.DeletePodcast(id.Value); err != nil {
|
if err := c.podcasts.DeletePodcast(id.Value); err != nil {
|
||||||
return spec.NewError(10, "failed to delete podcast: %s", err)
|
return spec.NewError(70, "failed to delete podcast: %s", err)
|
||||||
}
|
}
|
||||||
return spec.NewResponse()
|
return spec.NewResponse()
|
||||||
}
|
}
|
||||||
@@ -111,7 +114,7 @@ func (c *Controller) ServeDeletePodcastEpisode(r *http.Request) *spec.Response {
|
|||||||
return spec.NewError(10, "please provide a valid podcast episode id")
|
return spec.NewError(10, "please provide a valid podcast episode id")
|
||||||
}
|
}
|
||||||
if err := c.podcasts.DeletePodcastEpisode(id.Value); err != nil {
|
if err := c.podcasts.DeletePodcastEpisode(id.Value); err != nil {
|
||||||
return spec.NewError(10, "failed to delete podcast: %s", err)
|
return spec.NewError(70, "failed to delete podcast: %s", err)
|
||||||
}
|
}
|
||||||
return spec.NewResponse()
|
return spec.NewResponse()
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ func (c *Controller) ServeGetCoverArt(w http.ResponseWriter, r *http.Request) *s
|
|||||||
|
|
||||||
reader, err := coverFor(c.dbc, c.artistInfoCache, c.playlistStore, c.tagReader, id)
|
reader, err := coverFor(c.dbc, c.artistInfoCache, c.playlistStore, c.tagReader, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return spec.NewError(10, "couldn't find cover %q: %v", id, err)
|
return spec.NewError(70, "couldn't find cover %q: %v", id, err)
|
||||||
}
|
}
|
||||||
defer reader.Close()
|
defer reader.Close()
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ func (c *Controller) ServeGetCoverArt(w http.ResponseWriter, r *http.Request) *s
|
|||||||
resized := imaging.Fit(img, minSize, minSize, imaging.Lanczos)
|
resized := imaging.Fit(img, minSize, minSize, imaging.Lanczos)
|
||||||
|
|
||||||
if err := imaging.Save(resized, cachePath); err != nil {
|
if err := imaging.Save(resized, cachePath); err != nil {
|
||||||
return spec.NewError(10, "saving cover %q: %v", id, err)
|
return spec.NewError(0, "saving cover %q: %v", id, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
serve(cachePath)
|
serve(cachePath)
|
||||||
|
|||||||
@@ -79,13 +79,13 @@ func NewTCTrackByFolder(t *db.Track, parent *db.Album) *TrackChild {
|
|||||||
),
|
),
|
||||||
ParentID: parent.SID(),
|
ParentID: parent.SID(),
|
||||||
Duration: t.Length,
|
Duration: t.Length,
|
||||||
Year: parent.TagYear,
|
|
||||||
Bitrate: t.Bitrate,
|
Bitrate: t.Bitrate,
|
||||||
IsDir: false,
|
IsDir: false,
|
||||||
Type: "music",
|
Type: "music",
|
||||||
MusicBrainzID: t.TagBrainzID,
|
MusicBrainzID: t.TagBrainzID,
|
||||||
CreatedAt: t.CreatedAt,
|
CreatedAt: t.CreatedAt,
|
||||||
AverageRating: formatRating(t.AverageRating),
|
AverageRating: formatRating(t.AverageRating),
|
||||||
|
Year: t.TagYear,
|
||||||
}
|
}
|
||||||
if trCh.Title == "" {
|
if trCh.Title == "" {
|
||||||
trCh.Title = t.Filename
|
trCh.Title = t.Filename
|
||||||
|
|||||||
@@ -97,9 +97,9 @@ func NewTrackByTags(t *db.Track, album *db.Album) *TrackChild {
|
|||||||
DiscNumber: t.TagDiscNumber,
|
DiscNumber: t.TagDiscNumber,
|
||||||
Type: "music",
|
Type: "music",
|
||||||
MusicBrainzID: t.TagBrainzID,
|
MusicBrainzID: t.TagBrainzID,
|
||||||
Year: album.TagYear,
|
|
||||||
AverageRating: formatRating(t.AverageRating),
|
AverageRating: formatRating(t.AverageRating),
|
||||||
TranscodeMeta: TranscodeMeta{},
|
TranscodeMeta: TranscodeMeta{},
|
||||||
|
Year: t.TagYear,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ type InternetRadioStation struct {
|
|||||||
ID *specid.ID `xml:"id,attr" json:"id"`
|
ID *specid.ID `xml:"id,attr" json:"id"`
|
||||||
Name string `xml:"name,attr" json:"name"`
|
Name string `xml:"name,attr" json:"name"`
|
||||||
StreamURL string `xml:"streamUrl,attr" json:"streamUrl"`
|
StreamURL string `xml:"streamUrl,attr" json:"streamUrl"`
|
||||||
HomepageURL string `xml:"homepageUrl,attr" json:"homepageUrl"`
|
HomepageURL string `xml:"homePageUrl,attr" json:"homePageUrl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Lyrics struct {
|
type Lyrics struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user