Commit Graph

164 Commits

Author SHA1 Message Date
Deluan 11bef060a3 Small refactoring 2024-06-05 22:40:22 -04:00
Deluan abe5690018 Refactor string utilities into its own package `str` 2024-06-05 22:09:27 -04:00
Deluan 46fc38bf61 Fix tests expectations 2024-06-05 19:54:25 -04:00
Deluan b2ecc1d16f Fix G404 gosec lint error 2024-05-19 21:55:19 -04:00
Deluan bcaa180fc7 Fix 32 bits builds 2024-05-19 13:03:13 -04:00
Deluan 3977ef6e0f Make first WebUI random page stick 2024-05-19 12:35:30 -04:00
Deluan 653b4d97f9 Add missing Test function 2024-05-18 15:05:40 -04:00
Guilherme Souza 98218d045e
Deterministic pagination in random albums sort (#1841)
* Deterministic pagination in random albums sort

* Reseed on first random page

* Add unit tests

* Use rand in Subsonic API

* Use different seeds per user on SEEDEDRAND() SQLite3 function

* Small refactor

* Fix id mismatch

* Add seeded random to media_file (subsonic endpoint `getRandomSongs`)

* Refactor

* Remove unneeded import

---------

Co-authored-by: Deluan <deluan@navidrome.org>
2024-05-18 14:10:53 -04:00
Deluan 4d28d534cc Refactor random.WeightedChooser, unsing generics 2024-05-17 15:45:34 -04:00
Deluan 6f2643e55e Refactor to use more Go 1.22 features 2024-05-12 20:04:53 -04:00
Deluan 2c8c87a980 Remove duplicated test 2024-05-11 20:15:02 -04:00
Deluan 3463d0c208 Simplify random.Int64 usage with generics 2024-05-11 20:10:46 -04:00
Deluan 0ae2944073 Refactor random functions 2024-05-11 20:04:21 -04:00
Deluan 30ae468dc1 Uses Unix milliseconds support from standard Go lib 2024-05-11 19:50:30 -04:00
Deluan ec68d69d56 Refactor cache.HTTPClient 2024-05-11 19:37:12 -04:00
Deluan 955a9b43af Refactor merge.FS 2024-05-11 19:37:12 -04:00
Deluan Quintão c4b05dac28
Make sorting lists by name/title case-insensitive (#2993)
* Make sort by order_* fields case-insensitive.

* Sort internet radios by name case-insensitive
2024-05-09 07:08:15 -04:00
Deluan 2c06a4234e Fix int types in OpenSubsonic responses.
Refer to https://support.symfonium.app/t/symfonium-sync-crashes-when-tpos-is-not-an-int/4204
2024-05-01 13:57:11 -04:00
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