mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
Merge branch 'master' into radio-browser-search/5239
This commit is contained in:
commit
ae864a0e6c
2
.github/workflows/pipeline.yml
vendored
2
.github/workflows/pipeline.yml
vendored
@ -338,7 +338,7 @@ jobs:
|
|||||||
hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Create manifest list and push to Docker Hub
|
- name: Create manifest list and push to Docker Hub
|
||||||
uses: nick-fields/retry@v3
|
uses: nick-fields/retry@v4
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 5
|
timeout_minutes: 5
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
|
|||||||
@ -248,6 +248,7 @@ ExecStart={{.Path|cmdEscape}}{{range .Arguments}} {{.|cmd}}{{end}}
|
|||||||
TimeoutStopSec=20
|
TimeoutStopSec=20
|
||||||
RestartSec=120
|
RestartSec=120
|
||||||
EnvironmentFile=-/etc/sysconfig/{{.Name}}
|
EnvironmentFile=-/etc/sysconfig/{{.Name}}
|
||||||
|
Environment="ND_SYSTEMD_PRIORITY_LOGGING=1"
|
||||||
|
|
||||||
DevicePolicy=closed
|
DevicePolicy=closed
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
|
|||||||
@ -341,9 +341,11 @@ func Load(noConfigDump bool) {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
log.SetOutput(out)
|
log.SetOutput(out)
|
||||||
} else if os.Getenv("JOURNAL_STREAM") != "" {
|
} else if os.Getenv("ND_SYSTEMD_PRIORITY_LOGGING") != "" && os.Getenv("JOURNAL_STREAM") != "" {
|
||||||
// When running under systemd, prepend syslog priority prefixes so
|
// When running under systemd, prepend syslog priority prefixes so
|
||||||
// journald assigns the correct severity to each log line.
|
// journald assigns the correct severity to each log line.
|
||||||
|
// Note that we have an additional environment variable, as JOURNAL_STREAM
|
||||||
|
// can be present in a systemd environment even if not running as a systemd service
|
||||||
log.EnableJournalFormat()
|
log.EnableJournalFormat()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,8 +31,8 @@ func (s *playlists) parseM3U(ctx context.Context, pls *model.Playlist, folder *m
|
|||||||
filteredLines := make([]string, 0, len(lines))
|
filteredLines := make([]string, 0, len(lines))
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
line := strings.TrimSpace(line)
|
line := strings.TrimSpace(line)
|
||||||
if strings.HasPrefix(line, "#PLAYLIST:") {
|
if after, ok := strings.CutPrefix(line, "#PLAYLIST:"); ok {
|
||||||
pls.Name = line[len("#PLAYLIST:"):]
|
pls.Name = after
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if after, ok := strings.CutPrefix(line, "#EXTALBUMARTURL:"); ok {
|
if after, ok := strings.CutPrefix(line, "#EXTALBUMARTURL:"); ok {
|
||||||
|
|||||||
@ -65,7 +65,7 @@ var _ = Describe("getPID", func() {
|
|||||||
Context("calculated attributes", func() {
|
Context("calculated attributes", func() {
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
DeferCleanup(configtest.SetupConfig())
|
DeferCleanup(configtest.SetupConfig())
|
||||||
conf.Server.PID.Album = "musicbrainz_albumid|albumartistid,album,version,releasedate"
|
conf.Server.PID.Album = "musicbrainz_albumid|albumartistid,album,albumversion,releasedate"
|
||||||
})
|
})
|
||||||
When("field is title", func() {
|
When("field is title", func() {
|
||||||
It("should return the pid", func() {
|
It("should return the pid", func() {
|
||||||
@ -88,13 +88,13 @@ var _ = Describe("getPID", func() {
|
|||||||
It("should return the pid", func() {
|
It("should return the pid", func() {
|
||||||
spec := "albumid|title"
|
spec := "albumid|title"
|
||||||
md.tags = map[model.TagName][]string{
|
md.tags = map[model.TagName][]string{
|
||||||
"title": {"title"},
|
"title": {"title"},
|
||||||
"album": {"album name"},
|
"album": {"album name"},
|
||||||
"version": {"version"},
|
"albumversion": {"deluxe edition"},
|
||||||
"releasedate": {"2021-01-01"},
|
"releasedate": {"2021-01-01"},
|
||||||
}
|
}
|
||||||
mf.AlbumArtist = "Album Artist"
|
mf.AlbumArtist = "Album Artist"
|
||||||
Expect(getPID(mf, md, spec, false)).To(Equal("(((album artist)\\album name\\version\\2021-01-01))"))
|
Expect(getPID(mf, md, spec, false)).To(Equal("(((album artist)\\album name\\deluxe edition\\2021-01-01))"))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
When("field is albumartistid", func() {
|
When("field is albumartistid", func() {
|
||||||
|
|||||||
@ -544,7 +544,7 @@ var _ = Describe("LibraryService Integration", Ordered, func() {
|
|||||||
// Note: This test is slightly flaky due to a potential race condition in wazero's
|
// Note: This test is slightly flaky due to a potential race condition in wazero's
|
||||||
// WASI filesystem mounting. The test passes ~85% of the time. Using FlakeAttempts
|
// WASI filesystem mounting. The test passes ~85% of the time. Using FlakeAttempts
|
||||||
// to automatically retry on failure.
|
// to automatically retry on failure.
|
||||||
It("should read file from mounted library directory", FlakeAttempts(3), func() {
|
It("should read file from mounted library directory", FlakeAttempts(5), func() {
|
||||||
ctx := GinkgoT().Context()
|
ctx := GinkgoT().Context()
|
||||||
|
|
||||||
output, err := callTestLibrary(ctx, testLibraryInput{
|
output, err := callTestLibrary(ctx, testLibraryInput{
|
||||||
@ -557,7 +557,7 @@ var _ = Describe("LibraryService Integration", Ordered, func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Note: Uses FlakeAttempts for the same reason as the read_file test above
|
// Note: Uses FlakeAttempts for the same reason as the read_file test above
|
||||||
It("should list files in mounted library directory", FlakeAttempts(3), func() {
|
It("should list files in mounted library directory", FlakeAttempts(5), func() {
|
||||||
ctx := GinkgoT().Context()
|
ctx := GinkgoT().Context()
|
||||||
|
|
||||||
output, err := callTestLibrary(ctx, testLibraryInput{
|
output, err := callTestLibrary(ctx, testLibraryInput{
|
||||||
|
|||||||
@ -81,7 +81,7 @@ main:
|
|||||||
albumsort:
|
albumsort:
|
||||||
aliases: [ tsoa, albumsort, soal, wm/albumsortorder ]
|
aliases: [ tsoa, albumsort, soal, wm/albumsortorder ]
|
||||||
albumversion:
|
albumversion:
|
||||||
aliases: [albumversion, musicbrainz_albumcomment, musicbrainz album comment, version]
|
aliases: [albumversion, musicbrainz_albumcomment, musicbrainz album comment]
|
||||||
album: true
|
album: true
|
||||||
genre:
|
genre:
|
||||||
aliases: [ tcon, genre, ©gen, wm/genre, ignr ]
|
aliases: [ tcon, genre, ©gen, wm/genre, ignr ]
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package scheduler
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/navidrome/navidrome/log"
|
"github.com/navidrome/navidrome/log"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
@ -48,31 +47,4 @@ var _ = Describe("Scheduler", func() {
|
|||||||
Expect(id).ToNot(BeZero())
|
Expect(id).ToNot(BeZero())
|
||||||
s.Remove(id)
|
s.Remove(id)
|
||||||
})
|
})
|
||||||
|
|
||||||
It("removes a job", func() {
|
|
||||||
done := make(chan struct{})
|
|
||||||
|
|
||||||
counter := 0
|
|
||||||
id, err := s.Add("@every 50ms", func() {
|
|
||||||
counter++
|
|
||||||
if counter == 1 {
|
|
||||||
close(done)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
Expect(err).ToNot(HaveOccurred())
|
|
||||||
Expect(id).ToNot(BeZero())
|
|
||||||
|
|
||||||
// Verify job executed
|
|
||||||
Eventually(done).Should(BeClosed())
|
|
||||||
Expect(counter).To(Equal(1))
|
|
||||||
|
|
||||||
// Remove the job
|
|
||||||
s.Remove(id)
|
|
||||||
|
|
||||||
// Wait some time to ensure job doesn't execute again
|
|
||||||
time.Sleep(200 * time.Millisecond)
|
|
||||||
|
|
||||||
// Verify counter didn't increase
|
|
||||||
Expect(counter).To(Equal(1))
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user