Deluan
0f7d6b5bc4
More micro-optimizations
2024-06-06 07:11:43 -04:00
Deluan
939f3eee97
Initialize Index Groups regex just once
2024-06-05 23:00:36 -04:00
Deluan
b4ef1b1e38
Replace gg.If with cmp.Or
2024-06-05 22:48:00 -04:00
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
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
Deluan
950b5dc1ce
Remove math/rand and only use crypto/rand
2022-11-27 21:53:13 -05:00
Deluan
7bafbce816
Reduce number of goroutines in test, to avoid hitting the hard limit of 8128
2022-11-26 15:28:30 -05:00
Deluan
a69a31a3bf
Use custom atomic.Bool, as it is not supported in Go 1.18
2022-11-26 15:14:19 -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
d613b19306
Simplify Singleton usage by leveraging Go 1.18's generics
2022-07-27 12:15:05 -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
6a87fc88f7
Ignores invalid timestamps in requests (use current time)
...
Fix this issue: https://www.reddit.com/r/navidrome/comments/ql3imf/scrobbling_fails_when_using_substreamer/
2021-11-02 10:33:40 -04:00
Deluan
66a9cbb7d9
Remove temp folders after tests
2021-10-28 10:40:31 -04:00
Deluan
f645c4769c
Fix double escaped lyrics and comments
2021-10-26 19:33:21 -04:00
Deluan
76fdcd112b
Tweak SimilarSongs algorithm to prioritize the requested main artist
2021-10-24 18:04:40 -04:00
Deluan
1a96e9fe65
Import smart playlists (extension .nsp)
2021-10-23 20:25:28 -04:00
Deluan
dbde0ffa0c
Bump github.com/djherbis/atime to v1.1.0
2021-10-03 22:50:25 -04:00
Deluan
4fcb238295
Fix "too many SQL variables" error in GetStarred endpoint
2021-07-21 10:45:52 -04:00
Deluan
eeb14f0243
Removed unused function
2021-07-20 20:50:59 -04:00
Deluan
8afa2cd833
Remove dependency of deprecated ioutil package
2021-07-20 20:12:28 -04:00
Deluan
774ad65155
Use fs.FS in MergeFS implementation
2021-07-20 19:54:44 -04:00
Deluan
7cd3a8ba67
Add genre tables, read multiple-genres from tags
2021-07-20 17:45:08 -04:00
Deluan
b0fc684cb6
Fix small lint errors found by gocritic
2021-07-15 13:43:03 -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
a7509c9ff7
Send NowPlaying and Scrobbles to Last.fm
2021-06-23 11:01:58 -04:00
Deluan
25db2cb075
Add concurrency test for singleton
2021-06-20 11:51:32 -04:00
Deluan
f8ee6db72a
New implementation of NowPlaying
2021-06-20 10:39:16 -04:00
Deluan Quintão
66b74c81f1
Encrypt passwords in DB ( #1187 )
...
* Encode/Encrypt passwords in DB
* Only decrypts passwords if it is necessary
* Add tests for encryption functions
2021-06-18 18:38:38 -04:00
Deluan
f9eec5e4dc
Refactored agents calling into its own struct
2021-06-08 17:00:02 -04:00