Commit Graph

35 Commits

Author SHA1 Message Date
Deluan ec68d69d56 Refactor cache.HTTPClient 2024-05-11 19:37:12 -04: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
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 bd402fb2a8 Fix IntelliJ warning 2023-04-04 13:01:32 -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 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 4a7e86e989 Fix file descriptor leaking. 2023-02-02 10:36:49 -05:00
Deluan 580e9ae4bd Fix timer going awry 2023-01-17 22:04:09 -05:00
Deluan cc14485194 When trying to PreCache, wait for ImageCache to be available 2022-12-28 23:26:39 -05:00
Deluan 52a4721c91 Remove empty (invalid) entries from the cache 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 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 f82df70302 Add nilerr linter 2022-09-30 20:18:14 -04:00
Deluan a7a0e23956 Fix formatting 2022-09-26 21:28:10 -04:00
Deluan 31882abf6f Upgrade Ginkgo to V2 2022-07-26 16:53:17 -04:00
Deluan f4bffb1676 Update @djherbis's packages 2022-07-26 15:16:56 -04:00
Deluan 35bec14d4d Add missing test case for #1778 2022-07-25 23:34:09 -04:00
Deluan 321b3c5a64 Fix fscache key mapping. Closes #1778 2022-07-25 23:01:19 -04:00
Deluan 66a9cbb7d9 Remove temp folders after tests 2021-10-28 10:40:31 -04:00
Deluan dbde0ffa0c Bump github.com/djherbis/atime to v1.1.0 2021-10-03 22:50:25 -04:00
Deluan 8afa2cd833 Remove dependency of deprecated `ioutil` package 2021-07-20 20:12:28 -04:00
Deluan 94e36d7f60 Remove old feature flag for cache layout 2021-07-02 10:04:41 -04:00
Deluan 452c8dc44b Fixed the enduring nasty "too many files open" bug!! Fix #446 2021-07-01 12:07:32 -04:00
Deluan d1605dcfbe Replace `godirwalk` with standard Go 1.16 `filepath.WalkDir`
Should fix https://github.com/navidrome/navidrome/issues/1048
2021-04-27 11:28:47 -04:00
Deluan 240de70026 Add tests for SpreadFS 2021-04-22 14:02:42 -04:00
Deluan 467eb345ad Don't panic if fscache could not be initialized due to a FS error 2021-04-21 23:39:23 -04:00
Deluan 31b553e972 Add missing error log message in fscache initialization 2021-04-21 14:15:42 -04:00
Deluan 1d681d92d3 Better explanation of NewSpreadFS 2021-02-09 15:33:34 -05:00
Deluan 5fdd8b32d7 Move utilitarian/generic packages to utils: lastfm, spotify, gravatar, cache, and pool 2021-02-09 15:33:33 -05:00