Commit Graph

224 Commits

Author SHA1 Message Date
Deluan 25f68b6c89 If mediafile does not have an embedded coverart, use album's 2020-07-16 17:08:52 -04:00
Deluan 5620c58a30 Started the big refactor to extract common logic from `engine` package (Subsonic only) to `core` package (more generic) 2020-07-10 12:53:11 -04:00
Deluan d2e4cade62 Change duration config types 2020-07-02 17:53:51 -04:00
Deluan 7a9b848f38 Add quality to image cache key 2020-07-01 17:02:27 -04:00
Deluan 2371e9b943 Add option to set jpeg quality level. Closes #371 2020-06-29 17:20:38 -04:00
Deluan 890ca64f51 Fix `cover.jpg` discovery 2020-06-29 10:50:38 -04:00
Deluan 703875b895 Fallback to album art if mediaFile does not have cover art 2020-06-27 13:11:51 -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 d9c991e325 Return error when no matching cover is found
When checking stored references to cover images (whether embedded or
external), it's possible that configured patterns do no match, and a
valid error should be returned in those cases.
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 a6af46dbad Always use lowercase username, as it is used for referential integrity. Fixes #352 2020-06-14 20:20:10 -04:00
Deluan 7148741a4f Revert "Keep image aspect ratio when resizing"
This reverts commit 50f4bd86
2020-06-09 19:36:19 -04:00
Deluan 50f4bd86a3 Keep image aspect ratio when resizing 2020-06-09 10:34:47 -04:00
Deluan 888151728f Increase album art placeholder's resolution 2020-06-03 09:40:37 -04:00
Deluan 72e92c7318 Fix nil pointer dereference 2020-05-25 10:54:07 -04:00
Deluan e21262675e More log to media_streamer 2020-05-21 21:26:48 -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 d1a0ffaaee Check permissions in playlists 2020-05-16 23:14:28 -04:00
Deluan a56e588c8e Create relation table for playlist tracks 2020-05-16 18:35:34 -04:00
Deluan f8362a4acb Fix staticcheck's SA1029 2020-05-13 16:49:55 -04:00
Deluan 5ce3135f00 Fix gosec's G601 2020-05-13 15:32:42 -04:00
Deluan 1a9663d432 Move `static` to `resources`. Embed them at build time 2020-05-02 14:19:01 -04:00
jvoisin 26188e6d8a Enable a couple of linters 2020-04-29 09:03:07 -04:00
Deluan ddeefad501 Fix `goimport` and `gosec` warnings 2020-04-26 15:07:36 -04:00
Deluan 5cd453afeb Fix all `errcheck` warnings 2020-04-26 15:07:36 -04:00
Deluan 03c3c192ed Fixing static checks about passing nil context 2020-04-26 15:07:36 -04:00
Deluan 95790b9eff Remove unused code 2020-04-26 15:07:36 -04:00
Deluan f83d0d471d Fix getRandomSongs filters 2020-04-19 13:37:25 -04:00
Deluan 6cf4b81de9 Fix year range when querying by year 2020-04-18 14:05:44 -04:00
Deluan 1fd6571a87 Refactored getSongsByGenre 2020-04-17 21:44:34 -04:00
Deluan 4c0250f9f8 Add fromYear/toYear params to getRandomSongs 2020-04-17 21:44:34 -04:00
Deluan 0e1735e7a9 Add getSongsByGenre endpoint 2020-04-17 21:44:34 -04:00
Deluan a698e434fd Refactor list_generator to use new filters 2020-04-17 21:44:34 -04:00
Deluan 95f658336c Implement byYear and byGenre AlbumLists 2020-04-17 21:44:34 -04:00
Deluan db4479e720 Allow cache image to be disabled (workaround for #177) 2020-04-14 19:28:54 -04:00
Deluan 9fb4f5ef52 Removed Playlist.GetWithTracks, not needed anymore 2020-04-11 19:05:51 -04:00
Deluan e232c5c561 Add `created` and `changed` fields to playlists responses 2020-04-11 18:58:43 -04:00
jvoisin 1ef4fa970f Simplify a bit ffmpeg's transcoder
- Remove the useless "format" parameter
- createTranscodeCommand now returns a list of string, instead of (string, string[])
2020-04-10 13:00:29 -04:00
jvoisin b34523e196 Warn if ffmpeg can't be found 2020-04-10 10:56:58 -04:00
Deluan c2ec142ce3 More tests 2020-04-09 13:36:05 -04:00
Deluan 2d39a6df8d Remove duplicated fscache creation 2020-04-09 13:15:01 -04:00
Deluan 5265d0234f Fix tests for Cover service 2020-04-09 12:13:54 -04:00
Deluan 0fa8290ed3 Don't transcode if original format/bitrate is the same as the selected ones 2020-04-08 19:10:55 -04:00
Deluan 7e6c0e3894 Less noisy logs for scrobble 2020-04-06 19:42:35 -04:00
Deluan 647132625c Logs new stream sessions 2020-04-06 00:26:51 -04:00
Deluan fa378ab4e4 Add tracing log to Cover service 2020-04-05 22:48:07 -04:00
Deluan 05ffb1acad Cache cover arts. closes #19 2020-04-05 22:02:06 -04:00
Deluan a1ba5c59b2 Returns default cover on any error (not found, encoding, or unknown)
Only returns error if it cannot read the default image
2020-04-05 22:02:06 -04:00