Commit Graph

327 Commits

Author SHA1 Message Date
Aleksey Lobanov 457e1fc97b
Base SQL metrics in MetricsWorker (#2002)
* feat: Add metrics worker

* refactor: Add todos for useful for metrics methods

* feat: Run MetricsWorker is Prometheus is Enabled

* refactor: Unused low-level variable was removed in metrics

* feat: No worker for metrics, add more

* refactor: Unnecessary todo removed

* refactor: Remove dead unused constant

* Reduce metrics public interface

Co-authored-by: Deluan <deluan@navidrome.org>
2023-01-24 19:26:07 -05:00
Deluan 433da37982 Add Share to Context menus, also share artist 2023-01-24 18:36:47 -05:00
Deluan 6c05fcb699 Create contents label for group of shared mediafiles 2023-01-24 18:36:47 -05:00
Deluan d639da9eb5 Enable sharing only selected songs with the Subsonic API 2023-01-24 18:36:47 -05:00
Deluan e34f26588e Fix empty `entry` collection in Shares 2023-01-24 18:36:47 -05:00
Deluan d5df102f9f Implement `updateShare` and `deleteShare` Subsonic endpoints 2023-01-24 18:36:46 -05:00
Deluan d4c1d2ece4 Handle expired shares 2023-01-24 18:36:46 -05:00
Deluan d0dceae094 Add `getShares` and `createShare` Subsonic endpoints 2023-01-24 18:36:46 -05:00
Deluan 94cc2b2ac5 Fix tests and lint errors, plus a bit of refactor 2023-01-24 18:36:46 -05:00
Deluan 58fc271864 Share playlists 2023-01-24 18:36:46 -05:00
Deluan d9c42b3183 Add share's `contents` and `description` to the DB 2023-01-24 18:36:46 -05:00
Deluan 84aa094e56 More work on Shares 2023-01-24 18:36:45 -05:00
Deluan ab04e33da6 Initial work on Shares 2023-01-24 18:36:45 -05:00
Deluan 7073d18b54 Make private methods unpublished 2023-01-19 09:34:39 -05:00
Deluan 7fc964aec5 Don't wake CacheWarmer every 10 seconds, let it sleep :) 2023-01-18 19:31:15 -05:00
Deluan 127c75e34b Don't try to downsample if requested bitrate is equal or greater than original. Fix #2066 2023-01-18 13:20:51 -05:00
Deluan 580e9ae4bd Fix timer going awry 2023-01-17 22:04:09 -05:00
Deluan 17eab6a88d Fix resized image cache key 2023-01-17 20:58:38 -05:00
Deluan bedd2b2074 Implement better artwork cache keys 2023-01-17 20:37:10 -05:00
Kendall Garner 93adda66d9
Get album info (when available) from Last.fm, add getAlbumInfo endpoint (#2061)
* lastfm album.getInfo, getAlbuminfo(2) endpoints

* ... for description and reduce not found log level

* address first comments

* return all images

* Update migration timestamp

* Handle a few edge cases

* Add CoverArtPriority option to retrieve albumart from external sources

* Make agents methods more descriptive

* Use Last.fm name consistently

Co-authored-by: Deluan <deluan@navidrome.org>
2023-01-17 20:22:54 -05:00
Deluan 5564f00838 Some refactor, log message changes 2023-01-17 17:26:48 -05:00
Deluan e40da183bb Move artwork id encoding to public package 2023-01-16 15:24:25 -05:00
Deluan e3496c7eea Fix artist folder detection. Now works when the artist has only one album. 2023-01-14 14:36:27 -05:00
Deluan 16c869ec86 Optimize playlist cover generation 2023-01-13 22:18:34 -05:00
Deluan ab7668f562 Use a custom artist image cache key.
Invalidate when `Agents` config changes. This should solve https://github.com/navidrome/navidrome/issues/1601#issuecomment-1241702797
2023-01-13 22:18:34 -05:00
Deluan 94c6d47181 More descriptive error when artist.jpg not found 2023-01-13 22:18:34 -05:00
Deluan 0ffef05cc3 Remove "Biography not available" when agents are not available 2023-01-13 22:18:34 -05:00
Deluan 3f2d24695e PreCache artist images 2023-01-13 22:18:34 -05:00
Deluan c90468b895 Find `artist.*` image in Artist folder 2023-01-13 22:18:34 -05:00
Deluan 69e0a266f4 Remove size from public image ID JWT 2023-01-13 22:18:34 -05:00
Deluan 8f0d002922 Add local TopSongs 2023-01-13 22:18:34 -05:00
Deluan 77a99a735b Always access artist images through Navidrome (proxy calls to external URLs) 2023-01-13 22:18:34 -05:00
Deluan 918fee3ea3 Artwork reader for Artist 2023-01-13 22:18:34 -05:00
Deluan bf461473ef Add local agent, only for images 2023-01-13 22:18:34 -05:00
Deluan 387acc5f63 Add public endpoint to expose images 2023-01-13 22:18:34 -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 df0f140f9f Don't refresh smart playlists when generating covers 2023-01-01 20:28:03 -05:00
Deluan 6260927074 Serve artist placeholder directly, instead of using LastFM's CDN 2022-12-30 20:14:03 -05:00
Deluan cc14485194 When trying to PreCache, wait for ImageCache to be available 2022-12-28 23:26:39 -05:00
Deluan 14032a524b Reduce retention in CacheWarmer 2022-12-28 15:31:56 -05:00
Deluan 61e5523457 Handle "naked" CoverArtIDs (IDs of album, mediafiles and playlists) 2022-12-28 15:31:56 -05:00
Deluan bc09de6640 Better error handling 2022-12-28 15:31:56 -05:00
Deluan 949331ed24 GetCoverArt generates a tiled (2x2) image for playlists 2022-12-28 15:31:56 -05:00
Deluan 501386b11f Parse correctly playlist CoverArt ids 2022-12-28 15:31:56 -05:00
Deluan 8f3387a894 Fix tests and clean up code a bit 2022-12-28 15:31:56 -05:00
Deluan 332900774d Rename DevFastAccessCoverArt to EnableMediaFileCoverArt 2022-12-28 15:31:56 -05:00
Deluan 722a00cacf Fix artwork caching 2022-12-28 15:31:56 -05:00
Deluan 92ddae4a65 Created dedicated artwork readers 2022-12-28 15:31:56 -05:00
Deluan c1c4645501 Move artwork handling to its own package 2022-12-28 15:31:56 -05:00
Deluan 8cf78efb9c Add timeout for artwork extraction 2022-12-28 15:31:56 -05:00
Deluan e89d99aee0 Also caches resized images 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 f5719a7571 Fix spaces in CoverArtPriority, more trace logs in artwork resolution 2022-12-28 15:31:56 -05:00
Deluan 73bb0104f0 Cache original images 2022-12-28 15:31:56 -05:00
Deluan 26a7adae5f Change Image cache key format 2022-12-28 15:31:56 -05:00
Deluan 04eab5666a Add back CoverArtPriority 2022-12-28 15:31:56 -05:00
Deluan 045b023b35 Fix `DevFastAccessCoverArt` flag 2022-12-28 15:31:56 -05:00
Deluan 847a0432ea If resize fails, send the artwork as is. Closes #1102 2022-12-28 15:31:56 -05:00
Deluan bce7b163ba Skip trying to read cover art from mediafile if it does not have one 2022-12-28 15:31:56 -05:00
Deluan a087f57d2d Handle request (context) cancellation 2022-12-28 15:31:56 -05:00
Deluan e0da1d1589 Log artwork origin (tag, file, etc...) 2022-12-28 15:31:56 -05:00
Deluan 92b42b35b3 Fallback extracting tags using ffmpeg 2022-12-28 15:31:56 -05:00
Deluan abd3274250 Handle empty cover art ID in subsonic API 2022-12-28 15:31:56 -05:00
Deluan 0da27e8a3f Add image cache back 2022-12-28 15:31:56 -05:00
Deluan 40bb211b39 Small test refactor 2022-12-28 15:31:56 -05:00
Deluan 87d4db7638 Handle mediafile covers 2022-12-28 15:31:56 -05:00
Deluan 213ceeca78 Resize if requested 2022-12-28 15:31:56 -05:00
Deluan 7b87386089 Load artwork from embedded 2022-12-28 15:31:56 -05:00
Deluan c36e77d41f Remove CoverArtID, fix tests 2022-12-28 15:31:56 -05:00
Deluan 38bde0ddba Remove current Image Cache implementation 2022-12-28 15:31:56 -05:00
Deluan c430401ea9 Remove current artwork implementation 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 28389fb05e Add command line M3U exporter. Closes #1914 2022-12-21 14:39:40 -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
Kendall Garner 54395e7e6a
Enable transcoding of downlods (#1667)
* feat(download): Enable transcoding of downlods - #573

Signed-off-by: Kendall Garner <17521368+kgarner7@users.noreply.github.com>

* feat(download): Make automatic transcoding of downloads optional

Signed-off-by: Kendall Garner <17521368+kgarner7@users.noreply.github.com>

* Fix spelling

* address changes

* prettier

* fix config

* use previous name

Signed-off-by: Kendall Garner <17521368+kgarner7@users.noreply.github.com>
2022-12-18 12:12:37 -05:00
Deluan 6489dd4478 Fix overriding previous logger in context 2022-12-14 11:50:16 -05:00
Deluan f206d81afd Some cleanup, fixes typos and grammar errors 2022-12-06 20:09:03 -05:00
Deluan c5f7cf97f4 Some cleanup, adding missing context handling 2022-12-06 19:57:47 -05:00
gauth-fr 55ba39cb79
Add global Downsampling feature (#1575)
* Add global downsampling feature

* Default to Opus &  consider player transcoder

* Add a test case for DefaultDownsamplingFormat

Co-authored-by: Deluan <deluan@navidrome.org>
2022-12-06 19:41:16 -05:00
Deluan 00c6545cb1 Bump github.com/go-chi/jwtauth/v5 from 5.0.2 to 5.1.0 2022-12-02 17:58:53 -05:00
Deluan 2c214154dc Add nakedret linter 2022-11-30 14:16:30 -05:00
Raghd Hamzeh d5fe0f214c
fix: send content type header in listenbrainz requests - #1944 (#1994)
fixes #1944

Signed-off-by: Raghd Hamzeh <raghd@rhamzeh.com>

Signed-off-by: Raghd Hamzeh <raghd@rhamzeh.com>
2022-11-27 09:47:13 -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 88823fca76 Fix race conditions in tests 2022-11-26 15:07:53 -05:00
Deluan 0bb133a6ac Kill ffmpeg if context is cancelled 2022-11-26 15:06:59 -05:00
jan666 ab6be8d2dc
Listenbrainz Scrobble (#2009)
- send SubmissionClient and SubmissionClientVersion
2022-11-22 09:32:46 -05:00
Deluan 9c433b5d68 Add missing context to logger calls 2022-11-04 11:30:12 -04:00
Deluan f82df70302 Add nilerr linter 2022-09-30 20:18:14 -04:00
Deluan 77dbafff0f Add errorlint linter 2022-09-30 19:33:39 -04:00
Deluan db67c1277e Fix error comparisons 2022-09-30 18:54:25 -04:00
Andy Klimczak 2f7a3c5eda
feat: Add listenbrainz base url configuration (#1774)
* feat: Add listenbrainz base url configuration

- ListenBrainz.BaseURL config value

* Don't need to store baseUrl

* Use `url.JoinPath` to concatenate url paths

* Replace url.JoinPath (Go 1.19 only) with custom function

Co-authored-by: Deluan <deluan@navidrome.org>
2022-09-27 21:06:28 -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 028723f721 Fix loading overridden translations from ${DataFolder}/resources/i18n 2022-02-10 14:56:39 -05:00
Deluan 20cdd38fc4 Better logging for agents configuration 2021-11-25 15:48:32 -05:00