Commit Graph

277 Commits

Author SHA1 Message Date
Deluan c1c4645501 Move artwork handling to its own package 2022-12-28 15:31:56 -05:00
Deluan a087f57d2d Handle request (context) cancellation 2022-12-28 15:31:56 -05:00
Deluan 9fcd1c9354 Make internal method unexported 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 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
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 6c4a0be6ff Add endpoints in Subsonic API logs 2022-12-14 10:52:46 -05:00
Deluan 982b604500 Add username to authenticated log messages 2022-12-14 09:35:30 -05:00
Deluan c5f7cf97f4 Some cleanup, adding missing context handling 2022-12-06 19:57:47 -05:00
Deluan 0cc1db54d4 Bump github.com/bradleyjkemp/cupaloy to v2.8.0 2022-12-05 22:45:02 -05:00
Deluan 1b5f855bff Compress more http content-types.
Also, some minor refactoring
2022-11-26 13:13:05 -05:00
Deluan 19af11efbe Simplify Subsonic API handler implementation 2022-11-21 12:57:56 -05:00
Deluan 9c433b5d68 Add missing context to logger calls 2022-11-04 11:30:12 -04:00
Deluan 8f02daf337 Reduce spurious error/warn messages, if loglevel != debug 2022-11-03 12:38:05 -04:00
Deluan 80b7311453 Add TrackNumber to "fake" generated filenames. Fixes #1912 2022-11-02 12:11:01 -04:00
Deluan ca2cb26d8e Add `played` field to Subsonic API responses. Fix #1971
This is not an "official" field in the specification, but I guess it does not hurt to expose this ;)
2022-11-02 11:20:51 -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
Deluan 7b0a8f47de Add exportloopref linter 2022-09-30 18:23:47 -04:00
Manuel 72cde6dfde
fix:(middlewares.go) - Set Cookie SameSite mode to Strict - 1776 (#1777)
* None is deprecated and will fallback to Lax in the future.
* Using Strict is future proof and provides additional CSR protection

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>
2022-09-27 17:58:47 -04:00
Deluan 4cf43ed735 Only compute version once 2022-09-14 21:09:39 -04:00
Deluan 16afd3a490 Remove `//+build` tags, as the code does not compile on older versions of Go anymore 2022-07-29 08:41:28 -04:00
Deluan ebf7354df4 Add more info in search log message 2022-07-27 14:59:01 -04:00
Deluan c0066ebd85 Add log warn when request is cancelled/interrupted 2022-07-27 14:27:18 -04:00
Deluan cd5bce7b16 Speed up `/search` subsonic endpoints by parallelizing the queries 2022-07-27 13:56:04 -04:00
Deluan 31882abf6f Upgrade Ginkgo to V2 2022-07-26 16:53:17 -04:00
Deluan 9c3b14c5c4 Return 501 for "not implemented". Fixes #1785 2022-07-26 13:18:08 -04:00
Deluan 8cd405d15e Add IP to Subsonic API's invalid login log messages. Closes #1814 2022-07-25 23:54:49 -04:00
Deluan 028723f721 Fix loading overridden translations from ${DataFolder}/resources/i18n 2022-02-10 14:56:39 -05:00
Deluan 910091f1f1 Fix `playCount` casing 2021-12-14 09:33:34 -05:00
Deluan 30d3f1eda0 Add userRating to Subsonic Album/Artist responses. Closes #1486 2021-11-23 21:50:57 -05:00
Deluan 9712a5b1c6 Fix error codes for required parameters in getAlbumList 2021-11-02 21:38:08 -04:00
Deluan 9422373be0 Optimize AlbumRepository.GetAll and add a GetAllWithoutGenres method specifically for Subsonic API, where multiple-genres are not required 2021-11-02 21:19:49 -04:00
Deluan 133fed344f Add `owner_id` to `playlist` 2021-10-31 15:08:06 -04:00
Deluan 5dce499d6d Fix/Optimized Playlist tracks deletion 2021-10-26 14:05:28 -04:00
Deluan af00503b77 Optimize playlist updates 2021-10-26 10:45:14 -04:00
Deluan 1a96e9fe65 Import smart playlists (extension .nsp) 2021-10-23 20:25:28 -04:00
Deluan c72add516a Add methods to Playlist model
Also, don't load genres for Playlists tracks (not necessary for now)
2021-10-23 20:25:28 -04:00
Deluan d200933b68 Reduce number of queries for some playlists operations.
Also allow admins to update/delete playlists from other users in the Subsonic API. Closes #1366
2021-10-23 20:25:28 -04:00
Dheeraj Lalwani 5621551dd0
Adds Lyrics Support to Subsonic API (#1379)
* Add function 'isSynced' that identifies if lyrics are synced or not and add tests for the same

* implement 'getLyrics' which returns lyrics if they exist

Signed-off-by: Dheeraj Lalwani <lalwanidheeraj1234@gmail.com>

* remove timestamps frorom the the lyrics if they are synced, fix filters & clean up code

Signed-off-by: Dheeraj Lalwani <lalwanidheeraj1234@gmail.com>

* add snapshot tests for the 'Lyrics' response & add some clean up

Signed-off-by: Dheeraj Lalwani <lalwanidheeraj1234@gmail.com>

* add tests for 'GetLyrics' function

Signed-off-by: Dheeraj Lalwani <lalwanidheeraj1234@gmail.com>

* update the snapshot test & the test for 'GetLyrics' function

Signed-off-by: Dheeraj Lalwani <lalwanidheeraj1234@gmail.com>
2021-10-19 16:33:06 -04:00
Deluan b6e30cd01f Return playlists sorted in `getPlaylists` Subsonic endpoint 2021-10-05 14:47:57 -04:00
Deluan Quintão 91e36a2c18
Check goimports in the pipeline (#1381)
* Check goimports in the pipeline

* Check goimports in the pipeline

* Check goimports in the pipeline

* go mod tidy

* wip

* wip

* Fix goimports and go:build tags

* Run golangci-lint before goimports
2021-10-01 15:32:24 -04:00
caiocotts 210dc6b12e
Add x-total-count to Subsonic API getAlbumList (#1360)
* Add x-total-count to Subsonic API getAlbumList

* Rename variable

Co-authored-by: Deluan <deluan@navidrome.org>
2021-09-21 20:40:39 -04:00
Deluan 8afa2cd833 Remove dependency of deprecated `ioutil` package 2021-07-20 20:12:28 -04:00
Deluan 7540881695 Small refactorings 2021-07-20 19:18:29 -04:00
Deluan bc6b175414 Make `getGenre` Subsonic endpoint returns genres sorted by counts 2021-07-20 17:45:08 -04:00
Deluan b6e9ec4db4 Optimize GetAll genres query 2021-07-20 17:45:08 -04:00
Deluan 1d8607ef6a Remove unnecessary repositories methods 2021-07-20 17:45:08 -04:00
Deluan 5e54925520 Add multiple genres to Albums 2021-07-20 17:45:08 -04:00
Deluan 39da741a80 Add multiple genres to MediaFile 2021-07-20 17:45:08 -04:00
Deluan 7cd3a8ba67 Add genre tables, read multiple-genres from tags 2021-07-20 17:45:08 -04:00
Deluan 8d56ec898e Use AlbumArtist tag even for compilations, when it is specified.
If the tracks' AlbumArtists are different, then use "Various Artists"
2021-07-15 11:53:08 -04:00
Deluan 94533e585c Add tests to `/scrobble` endpoint 2021-06-26 13:52:29 -04:00
Deluan 056f0b944f Refactor: Consolidate scrobbling logic in play_tracker 2021-06-23 11:01:58 -04:00
Deluan a7509c9ff7 Send NowPlaying and Scrobbles to Last.fm 2021-06-23 11:01:58 -04:00
Deluan d5461d0ae9 Refactor Agents to be singleton
Initial work for Last.fm scrobbler
2021-06-23 11:01:58 -04:00
Deluan 80b2c2f3cf Try to register all playing music in GetNowPlaying 2021-06-20 11:25:15 -04:00
Deluan 97434c1789 Fix GetNowPlaying endpoint showing only the last play 2021-06-20 10:39:19 -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 86271f0412 Optimize refresh events for scrobble endpoint 2021-06-16 10:23:34 -04:00
Deluan fb7229a53e Refech using getMany, reducing the number of API calls 2021-06-16 10:01:09 -04:00
Deluan b65e76293a Only send events to clients who need it
- User events (star, rating, plays) only sent to same user
- Don't send to the client (browser window) that originated the event
2021-06-15 18:59:26 -04:00
Deluan 8383527aab Only refetch changed resources when receive a "refreshResource" event 2021-06-15 16:12:13 -04:00
Deluan Quintão 03efc48137
Refactor routing, changes API URLs (#1171)
* Make authentication part of the server, so it can be reused outside the Native API

This commit has broken tests after a rebase

* Serve frontend assets from `server`, and not from Native API

* Change Native API URL

* Fix auth tests

* Refactor server authentication

* Simplify authProvider, now subsonic token+salt comes from the server

* Don't send JWT token to UI when authenticated via Request Header

* Enable ReverseProxyWhitelist to be read from environment
2021-06-13 12:46:36 -04:00
Deluan e31802d2d3 Only send "refresh" event if `SetRating` was successful 2021-06-10 15:03:30 -04:00
Deluan cefc939909 Trigger UI refresh on media annotation events: `star`, `setRating` and `scrobble` 2021-06-10 12:20:52 -04:00
Deluan 110e17b004 Make MockRepo names more consistent 2021-06-08 16:30:19 -04:00
Deluan 675cbe11b3 Fix `updatePlaylist` not updating fields `comment` and `public`.
Fix #1140
2021-05-29 17:16:56 -04:00
Deluan 91a91f7e06 GetCoverArt returns placeholder if `id` is missing
This mimics Subsonic behaviour, even if it contradicts the API documentation, which states `id` is required

Fixes #1139
2021-05-29 11:37:00 -04:00
Deluan 22ce5b6282 Removed unnecessary code 2021-05-11 18:55:58 -04:00
Deluan 7d96167abc Upgrade to go-chi 5 2021-05-11 17:21:18 -04:00
Deluan 3e8d3e78c2 Fix Bookmarks Subsonic support (#1099)
JSON responses were incorrect
2021-05-07 09:47:13 -04:00
Deluan e3fe8399c8 Fix DevAutoCreateAdminPassword 2021-05-01 18:40:02 -04:00
Deluan 156a53c2ac Add support for artist 5-star rating in Subsonic API 2021-04-06 23:06:31 -04:00
Yash Jipkate e575825c33
Add `/` to `_` mapping for paths based on tags. (#888)
Closes  #592
2021-03-25 21:48:28 -04:00
Deluan 720e2357b7 Add option to sort Recently Added by file's mtime instead of time of import. 2021-03-12 18:18:35 -05:00
Deluan Quintão 2d528bbc87
Remove dependency of go-bindata (#818)
* Use new embed functionality for serving UI assets

* Use new embed functionality for serving resources. Remove dependency on go-bindata

* Remove Go 1.15
2021-03-12 11:06:51 -05:00
Deluan 107803e037 Update list of Not Implemented / Gone Subsonic API endpoints 2021-02-09 21:25:14 -05:00
Deluan 157faad028 Rename ExternalInfo to ExternalMetadata 2021-02-09 15:33:33 -05:00
Deluan 5fdd8b32d7 Move utilitarian/generic packages to utils: lastfm, spotify, gravatar, cache, and pool 2021-02-09 15:33:33 -05:00
Deluan 6ee45a9ccc Move project to Navidrome GitHub organization 2021-02-06 21:46:35 -05:00
Deluan 9668263235 Logging when triggering manual scan 2021-02-03 00:27:59 -05:00
Deluan 1f3bc4d202 Use tools.go commands without installing 2021-02-01 16:16:30 -05:00
Deluan 9520c30c32 Fix "failed" Subsonic response. Fix #716 2021-01-07 08:24:13 -05:00
Deluan 25ae1c6cdd Return album art as a Reader 2020-12-02 09:13:36 -05:00
Deluan 975579ab26 Add option for player to report real paths in Subsonic API. Closes #625 2020-11-28 10:25:23 -05:00
Deluan f29bb211d1 Better termination handling in Scanner's progress 2020-11-25 19:05:36 -05:00
Deluan a1dcb9a4e3 Show folders scanned instead of files scanned 2020-11-16 00:36:12 -05:00
Deluan b64bb706f7 Use Gravatar in GetAvatar Subsonic API 2020-11-13 14:57:49 -05:00
Deluan 08e63c867b Add config option to globally enable/disable downloads 2020-11-10 16:14:43 -05:00
Deluan 36596d4fdb Don't send the transcoded file if it is a HEAD request 2020-11-03 16:06:02 -05:00
Deluan ee5a0698c0 Simplify scanner utilization 2020-11-01 18:37:17 -05:00
Deluan 71b77cba2b Bump Subsonic API to 1.16.1 2020-11-01 17:04:53 -05:00
Deluan 8e584ee020 Update count on `getScanStatus` 2020-11-01 16:54:33 -05:00