Commit Graph

146 Commits

Author SHA1 Message Date
Deluan fa72aaa462 Move `TempFileName` to `utils` 2024-02-18 12:52:06 -05:00
Deluan 166eb37787 Use Go builtin min/max func 2024-02-16 21:53:16 -05:00
Deluan f7a4387d0e Bump github.com/jellydator/ttlcache/v2 to v2.11.1 2024-02-16 21:42:22 -05:00
Caio Cotts bf2bcb1279
Fix null values in DB (#2840)
* Fix album image_files being null.

* Fix small nitpick.

* Use ExecContext instead of Exec.

* Change more columns to not null and set default values.

* Remove columns that don't need to be changed from migration.

* Fix typo.

* Remove unnecessary select statements.

* Remove duplicate code.

* Do not apply changes to radio table.

* Do not apply changes full_text columns and respective indexes.

* Fix musicbrainz columns.

* Rename migration.

* Make ExternalInfoUpdatedAt nullable

* Make Share's timestamps nullable

---------

Co-authored-by: Deluan Quintão <deluan@navidrome.org>
2024-02-07 20:45:08 -05:00
Deluan fd61b29a84 Small readability improvement in MergeFS tests 2024-01-21 16:20:47 -05:00
Deluan 6f7b48202e Make the GetInstance concurrent test more readable 2023-12-28 16:50:07 -05:00
Deluan 0d8f8e3afd Optimize Singleton (sometimes a simple lock is a better solution) 2023-12-27 22:12:34 -05:00
Deluan 3f349b1b58 Add todo as a reminder to replace min/max in Go 1.22 2023-12-21 19:19:46 -05:00
Deluan dfcc189cff Replace all `utils.Param*` with `req.Params` 2023-12-21 17:41:09 -05:00
Deluan 00597e01e9 Add `req.Params` to replace `utils.Param*` 2023-12-21 16:32:37 -05:00
Deluan ac3668a33e Removed unused `diodes` package 2023-12-11 17:22:10 -05:00
Deluan 4cd7c7f39f Fix FileHaunter tests 2023-12-02 19:40:59 -05:00
Deluan 81daee3b9b Fix FileHaunter tests 2023-12-02 18:43:24 -05:00
Deluan 9b434d743f Ignore flaky FileHaunter tests 2023-12-02 18:32:48 -05:00
Deluan 9aa7b80d0d Generalize BreakUp/RangByChunks functions 2023-11-25 12:13:36 -05:00
Deluan ecadcfb403 Make `ParamInt` generic (any int type) 2023-11-23 13:40:06 -05:00
Deluan d6083dab6e Re-apply "Refactor walkDirTree to use fs.FS" but remove context cancelation logic.
This reverts commit 6b3b4d83ff.
2023-06-04 15:06:19 -04:00
Deluan 6b3b4d83ff Revert "Refactor walkDirTree to use fs.FS"
This reverts commit 3853c3318f.
2023-06-04 14:13:33 -04:00
Deluan 3853c3318f Refactor walkDirTree to use fs.FS 2023-06-03 22:25:19 -04:00
tomleb 257ccc5f43
Allow configuring cache folder (#2357)
* Set all clients to dev_download for make get-music

* Use multiple TranscodingCache instances in tests

This fixes flaky tests. The issue is that the TranscodingCache object
was being reused in tests from media_stream_Internal_test.go and
media_stream_test.go. If tests from the former was run first, the cache
would be filled up, so that when running tests from the latter, the `NON
seekable` test would fail.

* Allow configuring cache folder

This commit introduces a new configuration option to configure the cache
folder. This allows the cache to be in a separate folder such as
/var/cache/navidrome on Linux distributions.

* Fix tests

* Removed unused test setup code

---------

Co-authored-by: Deluan <deluan@deluan.com>
Co-authored-by: Deluan <deluan@navidrome.org>
2023-06-02 17:14:11 -04:00
Deluan 3fc4313e89 Move string slice functions to slice package as generic functions 2023-06-02 16:30:20 -04:00
Deluan bd402fb2a8 Fix IntelliJ warning 2023-04-04 13:01:32 -04:00
Deluan e6bfa2bb0b Convert our usage of go-diodes into a simplified, generic version 2023-04-01 21:53:45 -04:00
Deluan b998c05ca0 Some refactorings 2023-03-26 21:28:37 -04:00
Deluan a134b1b608 Use sync/atomic package, now that we are at Go 1.19 2023-02-15 21:21:59 -05:00
Deluan 6dce4b2478 Remove custom atomic.Bool, we are now at Go 1.19 2023-02-15 21:18:24 -05:00
Deluan aac6e2cb07 Add path to cookies. Fix #1580 2023-02-15 20:23:32 -05:00
Deluan 05c6cdea1a Don't cancel transcoding session if context is canceled 2023-02-07 09:58:50 -05:00
Deluan bfaf4a3388 Add logs to cache hunter 2023-02-06 10:41:33 -05:00
Deluan 0ce750d469 Update golangci-lint and fix lint errors 2023-02-02 11:10:28 -05:00
Deluan 4a7e86e989 Fix file descriptor leaking. 2023-02-02 10:36:49 -05:00
Deluan d5df102f9f Implement `updateShare` and `deleteShare` Subsonic endpoints 2023-01-24 18:36:46 -05:00
Deluan 20271df4fb Workaround to detect empty dates in some Subsonic clients 2023-01-24 18:36:46 -05:00
Deluan 580e9ae4bd Fix timer going awry 2023-01-17 22:04:09 -05:00
Deluan 7fbcb2904a Add function number.RandomInt64 2023-01-13 21:40:24 -05:00
Deluan 769e8bedba Rename WeightedChooser's method Put to Add, a better name 2023-01-13 19:43:27 -05:00
Deluan fdbece5c92 Use custom sanitize package, fix #2070 2023-01-12 13:39:05 -05:00
Deluan cc14485194 When trying to PreCache, wait for ImageCache to be available 2022-12-28 23:26:39 -05:00
Deluan 61e5523457 Handle "naked" CoverArtIDs (IDs of album, mediafiles and playlists) 2022-12-28 15:31:56 -05:00
Deluan 52a4721c91 Remove empty (invalid) entries from the cache 2022-12-28 15:31:56 -05:00
Deluan dc16ccdb93 Make tests compatible with GoLang 1.18 2022-12-28 15:31:56 -05:00
Deluan b6eb60f019 Add new Artwork Cache Warmer 2022-12-28 15:31:56 -05:00
Deluan 8c1cd9c273 Refactor file type functions 2022-12-28 15:31:56 -05:00
Deluan 9ec349dce0 Make sure album is updated if external cover changes 2022-12-28 15:31:56 -05:00
Deluan 73bb0104f0 Cache original images 2022-12-28 15:31:56 -05:00
Deluan 28e7371d93 Moved logic of collapsing songs into albums to model package
(it should really be called domain.... maybe will rename it later)
2022-12-28 15:31:56 -05:00
Deluan e03ccb3166 Replace MinInt/MaxInt with generic versions 2022-12-28 15:31:56 -05:00
Deluan 5943e8f953 Rename log.LevelCritical to log.LevelFatal 2022-12-21 14:53:36 -05:00
Deluan Quintão 24d520882e
Don't cache transcoded files if the request was cancelled (#2041)
* Don't cache transcoded files if the request was cancelled (or there was a transcoding error)

* Add context to logs

* Simplify Wait error handling

* Fix flaky test

* Change log level for "populating cache" error message

* Small cleanups
2022-12-18 12:22:12 -05:00
Deluan f206d81afd Some cleanup, fixes typos and grammar errors 2022-12-06 20:09:03 -05:00