Commit Graph

145 Commits

Author SHA1 Message Date
ejurgensen
3ee9204ff8 [xcode/daap/rsp] Default transcode to 320 kbps mp3 instead of wav
- Calculate size for both formats (+ move the return to transcode_encode_query)
- Let transcode_needed() decide what format to output
- Determine content-type from transcoding type
- Add transcode-dependent ability to override file metadata in rsp/daap
- Send file size matching format
2023-12-04 17:26:03 +01:00
ejurgensen
8013bac725 [artwork] Change search order for pipe artwork ("own" as fallback)
Ref. issue #1591
2023-04-03 22:33:21 +02:00
ejurgensen
c645d570ea [artwork] Also look for "own" artwork for pipes
Closes #1591
2023-03-15 22:08:59 +01:00
ejurgensen
5f342ea60b [httpd/artwork] Drop support for libevent <2.1.4 2023-03-07 21:01:10 +01:00
ejurgensen
2272f99599 [artwork] Fix for --disable-spotify broken in commit c8e46aa 2023-02-06 22:59:27 +01:00
ejurgensen
c8e46aad42 [artwork] Make Spotify online artwork getter thread safe
By making the global struct online_source's read-only. Before, the Spotify
handler was modifying auth_secret in a non-thread safe way.
2023-02-06 22:38:44 +01:00
chme
d277f7c7b3 [http/spotify] Add support for http sessions across multiple requests
This change allows to reuse curl handles for multiple requests.
Reusing a curl handle improves performance if more than one request is
made against a service (connection, session cache, dns cache are kept
between requests).
2022-05-01 09:01:23 +02:00
ejurgensen
f27eac8341 [artwork] Also use queue_item->artwork_url for pipe sources 2022-03-22 20:57:43 +01:00
ejurgensen
e321c54655 [artwork] Coverity fixups 2022-01-20 20:17:38 +01:00
chme
8becdee8f1 [db] Refactor db_query_fetch_* functions to take the output parameter
first and the input parameter as last parameter
2021-12-28 07:23:56 +01:00
chme
a65ee4462e [db] Refactor fetching query result into generic function
Additionally changes the return value in case the end of the result set
is reached.
2021-12-28 06:55:35 +01:00
ejurgensen
0d67f26662 [artwork] Fix memleak on pipe artwork error 2021-11-15 22:57:43 +01:00
ejurgensen
2bbc5f16c5 [xcode] Add support for seekable custom I/O (evbuffer input to transcode) 2021-05-31 11:55:32 +02:00
ejurgensen
a67c74ba6c [spotify] Introduce own spotifyc as replacement for libspotify 2021-05-31 11:54:30 +02:00
ejurgensen
1d5691be2f [artwork] Refactor artwork_get() and fix issue #1139
artwork_get() would return error for non-file images that shouldn't be
rescaled, which was a bit weird. This makes artwork_get() more straight-
forward.

Also fix issue #1139 simply by not calling artwork_get() in cases were
queue_item->artwork_url is an old temp file (in source_item_pipe_get).
2020-11-28 21:27:58 +01:00
ejurgensen
695927de2a [artwork] Remove old artwork_get_xxx in favor of new which has a format arg 2020-11-18 23:23:05 +01:00
ejurgensen
2098349fdb [artwork] Add ability to request a specific image format 2020-11-18 23:13:00 +01:00
ejurgensen
c20b85a6d9 [artwork] Always stash results of http requests in cache, even if negative
This is an attempt to be nice to peers, so that we don't make many similar
requests to e.g. Discogs. This could happen via proces_items() for an album
where we have the same artwork url for each track, and if it was 404 we
would continue attempting the same request for each track.
2020-10-20 23:22:49 +02:00
ejurgensen
0383f19e9f [artwork] Avoid repeating online search requests with same query
This changes online_source_search_check_last() so that it also works if the
last search query was unsuccesful, i.e. last_artwork_url was NULL.
2020-10-19 22:34:26 +02:00
ejurgensen
ce9fbff8f5 [artwork] Use cache stash to avoid making repeated requests
E.g. for an album we would for each track request artwork from Spotify, even
though the requests are similar and the first one didn't give a result.
2020-10-19 20:25:01 +02:00
ejurgensen
d9177dfb25 [artwork] Remove some superfluous checks
Credit lgtm.com
2020-08-10 22:50:04 +02:00
ejurgensen
552c201cf3 [artwork] Change cache strategy for artwork_url_get
Credit @sfeakes
2020-05-19 23:06:36 +02:00
ejurgensen
ca82857bfe [artwork] Add artwork_extension_is_artwork() + some fixup/renaming 2020-05-19 23:06:36 +02:00
ejurgensen
bb434297ca [artwork] Be more forgiving towards incorrect mime content-types 2020-05-15 23:10:43 +02:00
ejurgensen
1921a2401f [artwork] Fix memleak in source_item_pipe_get
Queue item not being freed on succes
2020-05-11 21:37:29 +02:00
ejurgensen
a6cb70fd66 [artwork] Don't use group handlers if unknown group (artist/album) 2020-05-11 17:24:05 +02:00
ejurgensen
86d49a7028 [artwork] Don't log Spotify artwork errors if user is not logged in
Ref issue #986
2020-05-05 16:23:55 +02:00
ejurgensen
37b4188c3c [artwork] Generalize handler configuration of supported media_kinds 2020-05-02 00:52:52 +02:00
whatdoineed2do/Ray
329c0620fc [artwork] query playlist-wide artwork if availble 2020-04-30 20:28:36 +02:00
ejurgensen
daf3922650 [artwork] Remove http instance of artwork_source for embedded
Commit 8510f7e should mean that it is not required any more, since we won't be
probing http streams unless we know they have artwork.
2020-04-25 21:59:18 +02:00
chme
8510f7e5f2 [artwork] Only try embedded artwork if dbmfi has ARTWORK_EMBEDDED flag 2020-04-25 21:58:21 +02:00
chme
14b4081769 [artwork] Ignore streams with media kind != music in artwork sources
"stream", "discogs", "coverartarchive", "spotify"
2020-04-12 10:49:56 +02:00
ejurgensen
c4cc366e6f [artwork] Avoid slow nowplaying artwork response -> slow Remote connect
Lower priority of potentielly slow embedded artwork retrieval, plus make sure
we tell the transcode module about http data kind, so that it can probe
quicker.
2020-04-07 22:54:10 +02:00
chme
67fd555b52 [artwork] Refactor artwork_get_dir_image 2020-03-14 07:03:06 +01:00
chme
6ba45e8d94 [artwork] Remove libspotify based artwork handler 2020-02-25 05:41:49 +01:00
ejurgensen
248f82f3c8 [db] Fixup fixup in commit #00de0a3 (upgrade dbvers to 21.3)
Forgot to include db_upgrade to v21.3
2020-02-23 21:26:00 +01:00
ejurgensen
1ed10771f1 [artwork] Get enablement of online srcs from settings
Settings will take care of consulting the cfg file now
2020-02-23 20:30:35 +01:00
ejurgensen
afa1a07a42 [artwork] Fix handling of cache + enable online srcs via config
* Don't save artwork for permanent items (file + Spotify) to the stash. The
  stash is only for short term artwork.
* If a request comes with a different max_w/max then search the online source
  again.
* Make artwork requests thread-safe by mutex protecting the search history.
* Add config option
2020-02-23 20:30:35 +01:00
ejurgensen
ad9ebb75c6 [artwork] Refinement of online artwork search
* Add system to avoid making too many futile requests + repeated requests
* Fixup Spotify artwork search (use type=track, type=album gave empty results)
* Include stash caching in artwork_get_byurl()
2020-02-23 20:30:35 +01:00
ejurgensen
a289135325 [artwork] Construct online src querys based on data_kind
For http streams we don't have an album name to search for. Plus we don't
want to cache those images.
2020-02-23 20:30:35 +01:00
ejurgensen
b73f33f8e9 [artwork] Use settings to enable online sources 2020-02-23 20:30:35 +01:00
ejurgensen
18cf2dbbbf [misc] Change json_drilldown to _select and fix error case 2020-02-23 20:30:35 +01:00
ejurgensen
70f0ff1f61 [artwork] Support for online artwork sources - WIP
* Discogs
* Spotify
* Cover Art Archive
2020-02-23 20:30:35 +01:00
ejurgensen
7316c060b8 [pipe/artwork] Support for artwork via Shairport metadata pipes, take 3
This implementation uses a tmpfile for storage of the artwork, plus it uses
artwork_get() which means that it scales the image as requested by the client.

It also does not create a tmpfile unless we actually receive artwork.
2019-09-20 21:47:17 +02:00
ejurgensen
ddb91e61ef [pipe/artwork] Support for artwork via Shairport metadata pipes, take 2
This implementation uses a tmpfile for storage of the artwork (instead of the
cache, which may not be enabled).
2019-09-20 21:47:17 +02:00
ejurgensen
69fafd873d [pipe/artwork] Support for artwork via Shairport metadata pipes
This implementation uses the cache for storage. Might change that to use a
tmpfile instead.
2019-09-20 21:47:17 +02:00
ejurgensen
4f5966c9ff [db] Speed up Q_PL query used by e.g. '/databases/1/containers' request
The previous solution would use subqueries to count the number of items and
streams in each playlist, which means that response time gets pretty slow if
there are many playlists.

This commit also includes a number of lesser db code changes.
2019-05-30 21:19:40 +02:00
ejurgensen
53780a7ef3 [xcode] Make sample rate + channels variable
This change is preparation to use ffmpeg's resampling capabilities to keep local
audio in sync (by up/downsampling slightly). This requires that sample rates are
not fixed for a transcode profile.

Added benefit of this is that we don't need quite as many xcode profiles.
2019-04-02 22:47:11 +02:00
chme
9b8bff45ab [artwork/http] Check response code and content type
Extends the http_client_ctx to hold the response code for a request.
Also adds the content type header, if it was a https request (using
libcurl instead of libevent)
2019-02-09 08:35:20 +01:00
chme
733a521df8 [spotify/artwork] Add spotify webapi as an additional artwork source 2019-02-05 16:04:08 +01:00