Commit Graph

39 Commits

Author SHA1 Message Date
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 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 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 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 1a9663d432 Move `static` to `resources`. Embed them at build time 2020-05-02 14:19:01 -04:00
Deluan 5cd453afeb Fix all `errcheck` warnings 2020-04-26 15:07:36 -04:00
Deluan db4479e720 Allow cache image to be disabled (workaround for #177) 2020-04-14 19:28:54 -04:00
Deluan 2d39a6df8d Remove duplicated fscache creation 2020-04-09 13:15:01 -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
Deluan 1bc68c20fc Create and configure image cache 2020-04-05 22:02:06 -04:00
Deluan 2d7998de59 Return cover from album even if client does not prefix the id with `al-`. Fixes #46 2020-04-02 22:03:27 -04:00
Deluan a35636999d feat: fine tune album art image size. better, but still not ideal 2020-04-01 09:09:51 -04:00
Deluan 0d2911daf9 refactor: add Context to the persistence layer 2020-01-27 09:41:33 -05:00
Deluan 1a0563db2d Fix test 2020-01-24 22:02:50 -05:00
Deluan 49f59fe9f4 Embed static files used by Subsonic API 2020-01-24 21:35:19 -05:00
Deluan bee55c04c8 Rename project to Navidrome 2020-01-23 19:44:08 -05:00
Deluan f0ee41a8af Add context to all methods in engine layer 2020-01-22 08:39:57 -05:00
Deluan 8a1110044c Better error handling when cover art cannot be loaded 2020-01-20 22:30:16 -05:00
Deluan 67eeb218c4 Big Refactor:
- Create model.DataStore, with provision for transactions
- Change all layers dependencies on repositories to use DataStore
- Implemented persistence.SQLStore
- Removed iTunes Bridge/Importer support
2020-01-19 16:28:09 -05:00
Deluan 0ea2bd79d9 Rename `domain` to `model` 2020-01-14 22:22:34 -05:00
Deluan c417a00e62 Renamed project to CloudSonic 2017-04-01 09:47:14 -04:00
Deluan a7ccd76d54 Allowing album cover ids with prefix (al-) 2016-03-30 10:01:37 -04:00
Deluan 1ed8c60130 Removing engine.ErrDataNotFound in favor of domain.ErrNotFound 2016-03-23 18:15:29 -04:00
Deluan 23cf069100 Using pointers for the receivers 2016-03-21 23:11:57 -04:00
Deluan c90a50827a Get() methods from all repositories now return a ErrNotFound when the id is nonexistent 2016-03-18 11:33:50 -04:00
Deluan 5fc3b3ff11 Renamed error variable 2016-03-10 11:25:15 -05:00
Deluan 2437eed586 Removed unnecessary "else"s 2016-03-10 09:37:35 -05:00
Deluan 371d0ea711 Added size parameter to getCoverArt.view endpoint 2016-03-08 23:38:51 -05:00
Deluan 00b4c44010 Refactored coverart logic to engine layer 2016-03-08 23:05:54 -05:00