Commit Graph

500 Commits

Author SHA1 Message Date
Deluan 947353610c Include never played songs in the "not in the last" operator 2021-10-23 20:25:28 -04:00
Deluan 2b57b98a4b Fix smart playlist refreshing only after the tracks were loaded 2021-10-23 20:25:28 -04:00
Deluan 21da1df4ea Cache smart playlist refreshes for 5 seconds 2021-10-23 20:25:28 -04:00
Deluan d21932bd1b First version of SmartPlaylists being generated on demand 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
Deluan 943082ef4e Fix time-based tests (again) 2021-10-23 20:25:28 -04:00
Deluan c3fb4e1282 Fix rules serialization 2021-10-23 20:25:28 -04:00
Deluan 9c8f779f42 Fix time-based tests 2021-10-23 20:25:28 -04:00
Deluan 815623715e Load SmartPlaylists rules from DB 2021-10-23 20:25:28 -04:00
Deluan 7221b49b98 More tests 2021-10-23 20:25:28 -04:00
Deluan cf8d08ec26 Initial drafts for Smart Playlists 2021-10-23 20:25:28 -04:00
Deluan fba733708c Sort songs by artist/album/disc/track_number before adding to playlist 2021-10-02 21:55:45 -04:00
Deluan 6c3e45de41 Add songs to playlists with drag and drop 2021-10-02 13:14:33 -04:00
Deluan ad45ab4a04 Fix genre update chunking 2021-10-01 08:43:59 -04:00
Deluan e17d436902 Do not attach Genres to the "Various Artists" artist 2021-09-27 21:55:33 -04:00
Deluan 5680e53949 Update genres in chunks. Should fix #1368 2021-09-26 15:55:52 -04:00
Deluan d481864035 Some small refactorings 2021-08-22 12:16:49 -04:00
Deluan c831dc4cdf Use `structs` lib to map models to DB. Fix #1266 2021-08-01 12:04:45 -04:00
Deluan 344d7a4392 Inject DB into DataStore, instead of hardcode the dependency 2021-07-31 20:15:20 -04:00
Deluan 5b81f7a73a Fix get song by id 2021-07-24 18:54:22 -04:00
Deluan 1cef44a543 Show in the logs which mbid will be used if multiple mbids are found for album/artist 2021-07-21 11:12:03 -04:00
Deluan 4fcb238295 Fix "too many SQL variables" error in `GetStarred` endpoint 2021-07-21 10:45:52 -04:00
Deluan 8afa2cd833 Remove dependency of deprecated `ioutil` package 2021-07-20 20:12:28 -04:00
Deluan 08840f6170 Simplify cover detection in roll-up code by left-joining synthesized table 2021-07-20 17:45:08 -04:00
Deluan cddd1b3f6b Simplify genre roll-up code by left-joining synthesized tables 2021-07-20 17:45:08 -04:00
Deluan b6e9ec4db4 Optimize GetAll genres query 2021-07-20 17:45:08 -04:00
Deluan 95181d748d Fix rollup of track genres to albums and artists.
See: https://github.com/navidrome/navidrome/pull/1251#issuecomment-882343022
2021-07-20 17:45:08 -04:00
Deluan 254e5673e1 Fix log message about artist with Various Artists' mbid 2021-07-20 17:45:08 -04:00
Deluan 00e418cb2a Fix log message about multiple MBIDs 2021-07-20 17:45:08 -04:00
Deluan 2742977c63 Fix multiple id3v2.4 genres appearing as one big concatenated genre 2021-07-20 17:45:08 -04:00
Deluan 69f71be98a Add more tests 2021-07-20 17:45:08 -04:00
Deluan 21cd50d81c Fix aggregated values (count, size, duration) in roll-up queries 2021-07-20 17:45:08 -04:00
Deluan a0cd585401 Fix Count methods 2021-07-20 17:45:08 -04:00
Deluan 20b7e5c49b Add Genre filters to UI 2021-07-20 17:45:08 -04:00
Deluan c56c7c865e Purge unused genres at the end of the scan 2021-07-20 17:45:08 -04:00
Deluan b56e034ce3 Add multiple genres to Artists 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 44e7502aef Log warning when artist has a MBID of Various Artists 2021-07-18 18:28:51 -04:00
Deluan b0fc684cb6 Fix small lint errors found by gocritic 2021-07-15 13:43:03 -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 289da56f64 Implement Scrobble buffering/retrying 2021-07-02 10:04:41 -04:00
Deluan fb183e58e9 Only encrypts NewPassword if it is not empty, when updating the user details. Fixes #1222 2021-07-01 16:09:49 -04:00
Brian Schrameck 167fe46288
Addresses a bug that would prevent users from changing their own passwords, introduced as part of #1187. (#1214) 2021-06-28 16:36:14 -04:00
Deluan ee21f3957e Pass userId explicitly to UserPropsRepository methods 2021-06-25 22:21:37 -04:00
Deluan 5001518260 Move user properties (like session keys) to their own table 2021-06-23 17:49:32 -04:00
Deluan 502a719e96 Implement Last.FM Desktop Auth flow endpoints 2021-06-21 18:14:01 -04:00
Deluan 97434c1789 Fix GetNowPlaying endpoint showing only the last play 2021-06-20 10:39:19 -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 110e17b004 Make MockRepo names more consistent 2021-06-08 16:30:19 -04:00
Deluan bebfe296a5 Allow updating only specific columns 2021-06-02 18:40:29 -04:00
Yash Jipkate 327c259a3d
Create share table and repository. (#930)
* Add share table and repository

* Add datastore mock

* Try fixing indent

* Try fixing indent - 2

* Try fixing indent - 3

* Implement rest.Repository and rest.Persistance

* Renew date

* Better error handling

* Improve field name

* Fix json name conventionally
2021-05-30 11:50:35 -04:00
Deluan 1940267a18 Handle functions with params in sort order.
Related to #1023
2021-05-28 17:35:32 -04:00
Steve Richter e60f2bfa3d
User management improvements (#1101)
* Show more descriptive success messages for User actions

* Check username uniqueness when creating/updating User

* Adjust translations

* Add tests for `validateUsernameUnique()`

Co-authored-by: Deluan <deluan@navidrome.org>
2021-05-16 13:25:38 -04:00
Deluan 874b17b8f6 Require user to provide current password to be able to change it
Admins can change other users' password without providing the current one, but not when changing their own
2021-05-03 15:03:34 -04:00
Deluan 7feda4bea4 Add `EnableUserEditing`, to control whether a regular user can change their own details (default `true`) 2021-05-02 17:11:12 -04:00
Deluan e3fe8399c8 Fix DevAutoCreateAdminPassword 2021-05-01 18:40:02 -04:00
Deluan a35de2bfd1 Allow regular users to change their info, including password.
Should fix #199
2021-04-28 22:35:25 -04:00
caiocotts b671d0ff7b
Better handling of album comments (#1013)
* Change album comment behaviour

* Don't check first item

* Fix previously imported album comments.

* Remove song comments if album comment is present
2021-04-24 21:40:55 -04:00
Deluan 5178f44094 Add `has_rating` filter to albums 2021-04-07 11:04:36 -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 6ee45a9ccc Move project to Navidrome GitHub organization 2021-02-06 21:46:35 -05:00
Deluan 22145e070f Replace custom chunking logic with a `utils.BreakUpStringSlice` call 2021-02-03 17:26:03 -05:00
Deluan 861b406575 Use new simplified `uuid.NewString()` syntax 2021-02-01 01:22:31 -05:00
Deluan 7cc9fbaaf9 Revert: Use modified time as updated_at and created_at when refreshing/creating albums 2021-02-01 00:30:45 -05:00
Deluan 9807b0b6c0 Use modified time as updated_at and created_at when refreshing/creating albums. Closes #717 2021-01-31 22:17:40 -05:00
Deluan 10e52bdd3f Use order_* fields for sorting by album and artist 2020-12-25 12:37:16 -05:00
Deluan 9e84ce42b5 Use same album songs order for UI and Subsonic API 2020-12-25 12:37:16 -05:00
lbonn 15b289201a Fall back to media file path when sorting
If files cannot be sorted by disc and track id, try by artist then
title.

One use case is a loose compilation of files with same album, album
artist, and no track numbers. File order was then undetermined, in
practice depended on insertion order in the database.
2020-12-25 12:37:16 -05:00
Deluan db5b9246dd Handle more sort/order cases 2020-12-23 11:37:38 -05:00
Deluan 4f90fa9924 Add denormalized list of artist_ids to album, to speed-up artist's albums queries
This will be removed once we have a proper many-to-many relationship between album and artist
2020-12-13 14:05:48 -05:00
Deluan 8bfaa0ad9d Better detection of ID fields, to use `=` instead of `LIKE` 2020-11-15 18:24:13 -05:00
Deluan 98af68ac99 Import comments and lyrics 2020-11-11 10:43:17 -05:00
Deluan 9bcd606fe8 Fix Artist full_text refresh 2020-11-02 10:27:01 -05:00
Deluan 7819e834c8 Fix Artist filtering 2020-11-02 09:58:51 -05:00
Deluan cfad35544b Add artistImageUrl available in getArtists endpoint
Also cache artist info in the DB for 1 hour
2020-11-01 14:37:29 -05:00
Deluan d0bf37a8a9 Move mock datastore to tests package 2020-10-27 15:23:49 -04:00
Deluan 313a088f86 Make mocks strongly typed 2020-10-27 15:23:49 -04:00
Deluan 1cfa7b2272 Change MediaFolder.ID type to int32 2020-10-25 23:22:52 -04:00
Deluan 173dd52fe1 Use MBID with most occurrences 2020-10-20 17:16:24 -04:00
Deluan 6663c079e0 Add MBIDs to media_file, album and artist 2020-10-20 16:27:22 -04:00
Deluan 40fd5bab34 Search for artists case-insensitive 2020-10-20 16:07:31 -04:00
Deluan 07535e1518 Add ExternalInformation core service (not a great name, I know) 2020-10-20 16:07:31 -04:00
Deluan 2f8dc794de Add and show Playlists sizes 2020-10-12 22:31:01 -04:00
Deluan 68a9be5e86 Add Artist (discography) size, and show sizes in Download caption 2020-10-12 22:31:01 -04:00
Jay R. Wren fd6edf967f
Add size to album details (#561)
* add size to album details

for #534

* addressing review comments:

* create index album(size)
* remove unneeded Size field from refresh struct
* add whitespace to album details
* add size to album list view

* prettier
2020-10-12 11:10:07 -04:00
Deluan 21f7c1906d Fix ByPath queries should not match partial filenames 2020-10-06 08:13:25 -04:00
Deluan abd51b2156 Use Subsonic API to star/unstar
This removes the need to update the annotations on Put(model), removing complexity and making it less buggy
2020-10-03 20:08:51 -04:00
Deluan f859772723 Remove dangling tracks after changing MusicFolder. Fix #445 2020-10-02 16:18:45 -04:00
Deluan 841c1129ff Break-up album/artist refresh in chunks 2020-09-09 08:57:59 -04:00
Deluan e50a720818 Sort by album name, then artist name 2020-09-07 16:21:29 -04:00
Deluan 596a4897a3 Do not force username to always be lowercase in the DB 2020-09-01 18:00:19 -04:00
Deluan 76e522710a New option: SearchFullString, to match query strings anywhere in searchable fields, not only in word boundaries
Based on feedback from @orlea, in https://github.com/deluan/navidrome/issues/255#issuecomment-683427754
2020-08-30 13:08:10 -04:00
Deluan a2e0acd6a2 Fix starring albums. Seems I may have lost a commit? 2020-08-15 15:03:03 -04:00
Deluan c2e03c8162 Add stars to Albums 2020-08-14 13:35:28 -04:00
Deluan f2ebbd26fa Add stars to Artist 2020-08-14 13:19:32 -04:00
Deluan ed726c2126 Better implementation of Bookmarks, using its own table 2020-08-01 12:17:15 -04:00
Deluan 23d69d26e0 Add Bookmarks to Subsonic API 2020-07-31 17:45:49 -04:00
Deluan 3d0e70e907 Add MediaFile to Bookmark 2020-07-31 17:45:49 -04:00
Deluan 34e843a4b3 Add updatedAt to Bookmarks 2020-07-31 17:45:49 -04:00
Deluan 2d3ed85311 Add bookmark in persistence layer 2020-07-31 17:45:49 -04:00
Deluan 3d4f4b4e2b Fix lint errors 2020-07-31 17:45:49 -04:00
Deluan 3000238a3c Implements the get/save play queue Subsonic endpoints and bumps API version to 1.12.0 2020-07-31 17:45:49 -04:00
Deluan 721a959735 Create playqueue table and repository 2020-07-31 17:45:49 -04:00
Deluan eae46d15bf Fix pagination 2020-07-29 15:34:48 -04:00
Deluan db8a48bba6 Implement album lists 2020-07-29 15:34:48 -04:00
Deluan 1b7f628759 Add tests for paths with UTF8 chars 2020-07-22 11:48:09 -04:00
Deluan 5a891fda9e Handle utf8 chars in paths 2020-07-22 09:36:22 -04:00
Deluan b9b6ce066b Auto-Import playlists found in the Music Folder 2020-07-17 22:55:51 -04:00
Deluan d14a6031f0 Add test for case-sensitive DeleteByPath 2020-07-14 15:35:42 -04:00
Deluan 8b20c26e04 Make "ByPath" queries case-sensitive 2020-07-14 15:27:27 -04:00
Deluan 33d5459c20 Escape paths in "ByPath" queries 2020-07-14 07:20:27 -04:00
Deluan dc8368c89c Return counter from DeleteByPath 2020-07-12 11:53:07 -04:00
Deluan f0ee52a98e Fix album refresh query. Fixes #373 2020-06-29 14:17:28 -04:00
Deluan c01d81802d Fix album's songCount. Fixes #373 2020-06-29 11:35:51 -04:00
Deluan 890ca64f51 Fix `cover.jpg` discovery 2020-06-29 10:50:38 -04:00
Deluan bcaf330233 Make sure to select cover art from media_file that has it. Fix #360 2020-06-27 22:16:07 -04:00
Deluan 5f40801a78 Add more logs to GC call 2020-06-26 10:23:05 -04:00
Deluan eb109ebeb4 Remove duplicated helper functions, move them to `utils` package 2020-06-24 20:48:42 -04:00
Alex Palaistras bb9a7fadc0 Add tests for external album cover processing
This implements basic tests for functionality related to loading and
processing external album covers, both on the scanning size, and on the
display side.
2020-06-24 20:48:42 -04:00
Alex Palaistras ac5d99c079 Check MIME type for cover on refresh, display
Files that match the `CoverArtPriority` setting will now be considered
eligible only if their extensions are of an 'image/*' MIME type (e.g.
'.png' for 'image/png', '.jpg' for 'image/jpeg'). This prevents matching
files that will likely not be valid during display.

In addition to the above, code for returning the cover image file from
scanned data will also check against the MIME type for the path stored,
instead of attempting to re-trace `CoverArtPriority` matches. This
simplifies the code and bypasses a number of edge-cases related to
inconsistent matching.
2020-06-24 20:48:42 -04:00
Alex Palaistras 08cd28af2d Load cover art from file directory
This commit adds support for loading cover art from media file
directories, according to configured filename priorities (of which an
additional, special choice of `embedded` is given).

Cover art paths are resolved during scanning and stored in the database
as part of the `album.cover_art_path` column; if embedded cover art is
matched, this will default to the path of the media file itself, and if
no cover art is matched at all.

Similarly, the `album.cover_art_id` column will default to a reference
to `media_file.id` if embedded cover art is wanted, but if an external
cover art file is matched, this will instead be set to a reference to
the `album.id` value itself, prefixed with the `al-` constant.

Stored cover art paths are once again resolved and matched against
configuration when covers are requested; that is, any change in
configuration between scanning and requesting cover art may not return
correct data until a re-scan is complete.

Tests will be added in future commits.
2020-06-24 20:48:42 -04:00
Deluan 2d1d992e17 Support Windows paths 2020-06-14 03:11:16 -04:00
Deluan e73b71aaf7 Remove tracks from DB that were deleted while Navidrome was not running. Fixes #151 2020-06-14 03:11:16 -04:00
Deluan 3190611ec8 Call `ffmpeg` in batches 2020-06-14 03:11:16 -04:00
Deluan 6a3dabbb06 Optimize queries by path 2020-06-14 03:11:16 -04:00
Deluan 0033966c25 No need to delete the playlist tracks explicitly 2020-06-10 18:07:10 -04:00
Deluan 94d88395e7 Add referential integrity to player and playlist tables 2020-06-10 18:07:10 -04:00
Deluan c9bcb333ae Add more options to Players list 2020-06-10 18:07:10 -04:00
Deluan 29c7513879 Update `updated_at` field when modifying the playlist 2020-06-09 07:55:35 -04:00
Deluan b4e06c416d Allow toggling a playlist public from the Playlist list view. Closes #344 2020-06-08 18:39:31 -04:00
Deluan c6f23139bc Handle playlist's permissions on server 2020-06-05 11:55:29 -04:00
Deluan 331fa1d952 Add ability to reorder playlist items 2020-06-04 19:05:41 -04:00
Deluan d8699b03bd Fix album sort fields 2020-05-28 20:48:58 -04:00
Deluan 201a22e613 Change index in playlist to start from `1` 2020-05-26 13:50:15 -04:00
Deluan aaa4f1531e Ignore brackets in search 2020-05-25 11:05:30 -04:00
Deluan e811816021 Fix pagination in Songs when filtered by starred 2020-05-23 00:43:45 -04:00
Deluan 9331be67a3 Fix pagination in Songs 2020-05-23 00:17:35 -04:00
Deluan ec0002e77a Add a sortable Starred column and a Starred filter to Song List 2020-05-22 23:10:58 -04:00
Deluan 8a68cecdb9 Add ToggleStar to SongContextMenu (WIP) 2020-05-22 15:23:42 -04:00
Deluan 17df63b550 Fix `child.size` and `directory.playCount` compatibility with Subsonic API. Fixes #304 2020-05-19 23:51:23 -04:00
Deluan c2d1e9df9f Remove orphan tracks from playlists after they are removed from library 2020-05-18 20:32:01 -04:00
Deluan d1a0ffaaee Check permissions in playlists 2020-05-16 23:14:28 -04:00
Deluan 12cf2f1104 Remove tracks from playlist 2020-05-16 18:35:34 -04:00
Deluan e81a9dd1b5 Add tracks to playlist 2020-05-16 18:35:34 -04:00
Deluan 8a709c489a Add playlist views 2020-05-16 18:35:34 -04:00
Deluan 5682d0e721 Remove tracks from Playlist's GetAll 2020-05-16 18:35:34 -04:00