diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index eb7523d4e..2529aaf36 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -338,7 +338,7 @@ jobs: hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }} - name: Create manifest list and push to Docker Hub - uses: nick-fields/retry@v3 + uses: nick-fields/retry@v4 with: timeout_minutes: 5 max_attempts: 3 diff --git a/cmd/svc.go b/cmd/svc.go index e277bd459..89ca08056 100644 --- a/cmd/svc.go +++ b/cmd/svc.go @@ -248,6 +248,7 @@ ExecStart={{.Path|cmdEscape}}{{range .Arguments}} {{.|cmd}}{{end}} TimeoutStopSec=20 RestartSec=120 EnvironmentFile=-/etc/sysconfig/{{.Name}} +Environment="ND_SYSTEMD_PRIORITY_LOGGING=1" DevicePolicy=closed NoNewPrivileges=yes diff --git a/conf/configuration.go b/conf/configuration.go index a5c253746..5f74d6db0 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -341,9 +341,11 @@ func Load(noConfigDump bool) { os.Exit(1) } 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 // 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() } diff --git a/core/playlists/parse_m3u.go b/core/playlists/parse_m3u.go index 97ed7df6f..b9f5c92a2 100644 --- a/core/playlists/parse_m3u.go +++ b/core/playlists/parse_m3u.go @@ -31,8 +31,8 @@ func (s *playlists) parseM3U(ctx context.Context, pls *model.Playlist, folder *m filteredLines := make([]string, 0, len(lines)) for _, line := range lines { line := strings.TrimSpace(line) - if strings.HasPrefix(line, "#PLAYLIST:") { - pls.Name = line[len("#PLAYLIST:"):] + if after, ok := strings.CutPrefix(line, "#PLAYLIST:"); ok { + pls.Name = after continue } if after, ok := strings.CutPrefix(line, "#EXTALBUMARTURL:"); ok { diff --git a/model/metadata/persistent_ids_test.go b/model/metadata/persistent_ids_test.go index ad81eaa53..9f1dacbd4 100644 --- a/model/metadata/persistent_ids_test.go +++ b/model/metadata/persistent_ids_test.go @@ -65,7 +65,7 @@ var _ = Describe("getPID", func() { Context("calculated attributes", func() { BeforeEach(func() { 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() { It("should return the pid", func() { @@ -88,13 +88,13 @@ var _ = Describe("getPID", func() { It("should return the pid", func() { spec := "albumid|title" md.tags = map[model.TagName][]string{ - "title": {"title"}, - "album": {"album name"}, - "version": {"version"}, - "releasedate": {"2021-01-01"}, + "title": {"title"}, + "album": {"album name"}, + "albumversion": {"deluxe edition"}, + "releasedate": {"2021-01-01"}, } 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() { diff --git a/plugins/host_library_test.go b/plugins/host_library_test.go index d92abfe30..5746a3bed 100644 --- a/plugins/host_library_test.go +++ b/plugins/host_library_test.go @@ -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 // WASI filesystem mounting. The test passes ~85% of the time. Using FlakeAttempts // 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() 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 - 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() output, err := callTestLibrary(ctx, testLibraryInput{ diff --git a/resources/mappings.yaml b/resources/mappings.yaml index d1da5c620..19ba0b090 100644 --- a/resources/mappings.yaml +++ b/resources/mappings.yaml @@ -81,7 +81,7 @@ main: albumsort: aliases: [ tsoa, albumsort, soal, wm/albumsortorder ] albumversion: - aliases: [albumversion, musicbrainz_albumcomment, musicbrainz album comment, version] + aliases: [albumversion, musicbrainz_albumcomment, musicbrainz album comment] album: true genre: aliases: [ tcon, genre, ©gen, wm/genre, ignr ] diff --git a/scheduler/scheduler_test.go b/scheduler/scheduler_test.go index 795f07115..1a134a7f3 100644 --- a/scheduler/scheduler_test.go +++ b/scheduler/scheduler_test.go @@ -2,7 +2,6 @@ package scheduler import ( "testing" - "time" "github.com/navidrome/navidrome/log" . "github.com/onsi/ginkgo/v2" @@ -48,31 +47,4 @@ var _ = Describe("Scheduler", func() { Expect(id).ToNot(BeZero()) 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)) - }) })