Commit Graph

109 Commits

Author SHA1 Message Date
whatdoineed2do/Ray
d28f7f43b7 [jsonapi,mpd,conf] save playlist via JSON api
- new endpoint api/queue/save?name= to .m3u via library_save()
- refact for common cfg for playlist save options
2019-05-30 07:23:04 +02:00
chme
f85df07308 [jsonapi] Respect order defined in smartpl expression in queue/items/add 2019-02-23 11:02:12 +01:00
chme
e078ba8ed0 [jsonapi] Use same order by clause when adding queue items by
expressions as is used in search tracks by expression
2019-02-23 11:02:12 +01:00
chme
a3f2551eea [jsonapi] Support starting playback from position in queue/items/add 2019-02-23 09:41:58 +01:00
chme
3343e9cfc8 [jsonapi] Rename queue item "albumartist_id" to "album_artist_id"
Keeps it in sync with the naming in the track object. Also introduce a
helper function to add an int64 as a json string.
2019-02-14 08:22:50 +01:00
whatdoineed2do/Ray
17022c9103 [jsonapi] expose albumid/artistid persistent id on queue object 2019-02-12 09:21:39 +00:00
chme
0ded6d63bf [db/jsonapi] New admin value for Last-Modified in JSON API header
This adds a new timestamp value "db_modified" into the admin db table.
In addition to the existing "db_update" admin value, this value is also
updated if rating, play-/skip-count or seek changes for a
media_info_file (files db table).

This should improve the caching behavior in clients of the JSON API
(especially the player web interface) in refreshing its data if some of
this values changes.
2019-01-31 09:42:53 +01:00
chme
3bc15e1278 [jsonapi] Add endpoint to update a tracks rating and/or play_count
New endpoint is PUT api/library/tracks/[id] and supported query
parameters are:
- rating: with values between 0 and 100
- play_count: with values "reset" (resets play_count and skip_count) or
"increment" (increments play_count)
2019-01-31 09:42:53 +01:00
chme
b9a7ce7dd2 [jsonapi] Add endpoint to retrieve details for a single track by its id 2019-01-31 09:42:53 +01:00
chme
9fff02841b [jsonapi] Fix error in web interface files-view if the library directory
end with a trailing slash
2019-01-28 15:00:18 +01:00
chme
116c315a84 [player] Rename struct spk_info to player_speaker_info 2019-01-22 17:47:15 +01:00
chme
343c583229 [jsonapi] Support changing volume by the given step (increase/decrease
volume)
2019-01-21 11:11:20 +01:00
chme
c165c55b5b [jsonapi] Add player/toggle endpoint
Toggles playback state depending on the current player state:
- playing --> pause
- paused, stopped --> play
2019-01-20 12:03:50 +01:00
chme
fb60a05228 [jsonapi] Add support for "playback", "clear" and "shuffle" parameters
in
"queue/items/add" endpoint
2019-01-05 07:21:36 +01:00
chme
77a19a6df9 [jsonapi] Add checks for failed playback start and return error code 2019-01-02 09:51:54 +01:00
chme
0f4cbb3375 [http/jsonapi] Use strtok_r instead of strtok 2019-01-02 09:51:54 +01:00
chme
b3853ef0f3 [jsonapi] Check for empty "uris" parameter in queue/items/add (prevents
a segfault) and log failed requests in error log
2019-01-02 09:51:54 +01:00
chme
2ead24a2f7 [jsonapi] Add optional expression parameter to queue/items/add endpoint
Adds support to add tracks by a smart pl query expression
2019-01-02 09:51:54 +01:00
chme
ca99bf8718 [jsonapi] Sort files by filename and return directories in api/config 2019-01-02 09:51:54 +01:00
whatdoineed2do/Ray
e9f92ba1a7 [jsonapi] correct count of tracks added returned 2018-12-24 19:27:19 +00:00
chme
dcbe503686 [jsonapi] Return number of items added in queue/items/add endpoint
response
2018-12-20 11:19:47 +01:00
chme
2b7ff60771 [jsonapi] Fix playing from position if player state is shuffled 2018-12-20 11:19:47 +01:00
chme
b558e3498d [jsonapi] Add rating and title_sort to track object 2018-12-20 11:19:47 +01:00
chme
e6dc2a5845 [jsonapi] Add new endpoint "api/library/files"
This endpoint allows traversing the directory tree of the local library.
2018-12-18 08:28:19 +01:00
whatdoineed2do/Ray
cfadcc184f [jsonapi] support composer in queue and track objs 2018-11-30 17:22:21 +01:00
chme
89ca5e8ba9 [jsonapi] Fix wrong artwork url for non library queue items and streams
Add check against the special file_id DB_MEDIA_FILE_NON_PERSISTENT_ID to
identify if a queue item is not in the library. And always prefer the
artwork url in the queue item before the artwork for the library file.
2018-11-25 10:07:55 +01:00
chme
8d8663e93d [db/queue] Support adding non-library items at a given position to the
queue
2018-10-25 19:36:43 +02:00
chme
d2390933e9 [jsonapi] Support "position" parameter in queue/items/add endpoint 2018-10-25 19:36:43 +02:00
ejurgensen
41126d7be4 [artworkapi/jsonapi] Retrieve artwork for track/album/artist 2018-10-07 21:54:38 +02:00
chme
7252b3e509 [db] Add support to add items to the queue at specified position 2018-09-16 09:36:43 +02:00
whatdoineed2do
e3ce003190 genre search functionality (#559)
* [jsonapi] Add support for listing albums for genres
2018-09-02 09:05:18 +02:00
ejurgensen
fde0a28142 Support for skip_count and time_skipped file metadata 2018-08-18 22:56:27 +02:00
chme
705b7013c3 [player/dacp/mpd/json] Update master volume after setting speaker volume
Changing a speaker volume in a DACP clients results in two dacp requests
(at least in Retune):

setproperty?include-speaker-id=0&dmcp.volume=41
setproperty?speaker-id=198018693182577&dmcp.volume=43

The first request sets the absolute volume for the speaker (player.c -
volume_setabs_speaker). The second request is only triggered if the
volume from the first one is not the new master volume. This second
requests adjusts the relativ volume based on the loudest device (new
master volume) (player.c - volume_setrel_speaker). After the second
request the master volume and the relative volumes are correct (range
from 0 - 100 percent and master volume is 100 percent).

MPD and JSON API clients only set the absolute volume which results in
inconsistent master_volume and relative volumes. The added option to
update the master volume in volume_setabs_speaker/volume_setrel_speaker
makes sure the master volume and the relative volumes are correctly set.
2018-05-31 10:49:53 +03:00
chme
843fbeb066 [jsonapi] Add non-library uris to the queue 2018-05-10 07:02:15 +02:00
chme
7bab990eb3 [spotify/jsonapi] Expose access token and user country in JSON API
spoitfy endpoint
2018-05-10 07:02:15 +02:00
chme
eaab6f887b [spotify] Decoupling of the spotify webapi from libspotify integration
Separation of scanning Spotify songs into the library (spotify_webapi.c)
and playing Spotify songs through libspotify (spotify.c).
2018-05-09 22:47:37 +02:00
chme
85257788ba [jsonapi] Add cache control header to count endpoint and fix
not-modified-since check to check against the last db update instead of
last start time
2018-05-09 22:29:52 +02:00
chme
41e99ca3cd [db/mpd/jsonapi] Include artist and album count in filecount query; add
count endpoint and additional metadata to JSON API; remove unused
artist-/album-count queries
2018-05-09 22:29:52 +02:00
chme
f167e975c2 Unify naming of "order by" clause in structs/table 2018-04-15 22:11:40 +02:00
chme
d15018cb99 [httpd/jsonapi] Add cache control headers to some json api endpoints
Adds utility functions to httpd.c for checking the request headers for
either an "If-None-Match" or an "If-Not-Modified-Since" headers. If the
header value is found and it matches the current value for the requested
resource, we return early with a http response code 403 (Not Modified).
If the request header value is not present or does not match we add the
current ETag/Last-Modified values to the response headers and process
the request normally.
2018-04-15 22:11:40 +02:00
chme
99a812ad9a [jsonapi] Add new endpoints for artist/album/playlist/seek 2018-04-15 22:11:40 +02:00
chme
33459bd4ef [jsonapi] Extend search endpoint to support queries in smartpl language 2018-04-15 22:11:40 +02:00
chme
a78ed20848 [jsonapi] Add new JSON api endpoints
Allows
- browsing artists/albums/playlists
- search
- moving a queue item
2018-03-14 19:22:13 +01:00
chme
d1b47465a8 [jsonapi] Disable gzipping response
An attempt to improve the performance of the artists and albums
endpoints.
2018-03-14 19:21:57 +01:00
ejurgensen
b1c9518a78 [-] Make json-c a required library
Already kind of was required, as it was required by Spotify, Chromecast and the web api
2018-02-22 21:49:11 +01:00
chme
1212723072 [jsonapi] Do not set "DAAP-Server" header in json api response 2018-02-15 19:19:13 +01:00
chme
0e9feac829 [jsonapi] Rework outputs endpoint and strictly match uris by request
method
2018-02-15 19:19:13 +01:00
chme
a98713ba49 [jsonapi] Return proper HTTP status codes 2018-02-11 10:55:11 +01:00
chme
93879c6f90 [player] Refactor speaker enumerate callback 2018-02-10 09:04:18 +01:00
chme
5cb33189df [jsonapi] New endpoints for player.html
- control playback and retrieve player status
- get current queue
- set shuffle, repeat, consume mode
- set volume
2017-12-13 21:44:33 +01:00
chme
80c1ef3114 [jsonapi] New endpoints for outputs and device verification 2017-12-03 10:46:03 +01:00
ejurgensen
3d5aeda7aa [httpd] Implement "trusted_networks" option
Some clients aren't really capable of authenticating + some users probably
don't want to enter a password for the web interface. This option allows
clients on for instance the local network to connect without authentication.
2017-11-12 21:29:57 +01:00
ejurgensen
473a29ef8a [httpd] More refactoring, reduce code duplication in the httpd_xxx modules 2017-11-11 22:20:09 +01:00
ejurgensen
709d99d4c4 [httpd] Major refactor of the httpd request handling
Make it easier to add new parameters later, get rid of redundant code, clean
up, align between httpd_xxx modules and introduce new bugs. Yes, the refactor
got a bit out of hand.
2017-11-11 22:20:09 +01:00
chme
f82b22042f [lastfm/jsonapi/ws/main] New JSON-API-endpoints for Last.fm integration
In preparation for the new endpoints the following refactorings where
done in lastfm.c:
- Initialize lastfm.c in main.c instead of on first scrobble attempt
(necessary to retrieve the correct lastfm status)
- Return error messages if login attempt failed
- Add api function for status and logout
- Notify about Last.fm status changes

Unrelated changes in lastfm.c are:
- Refactoring of request_post
- Add request parameters sorted alphabetically and remove calling the
sort method in request_post
2017-10-28 12:22:45 +02:00
chme
6c45b808c0 [httpd/jsonapi] Fix unused variables when compiling without (#421)
--enable-spotify
2017-09-16 12:37:32 +02:00
ejurgensen
507bec8b8e [-] Fixup ifdef WEBSOCKET->HAVE_LIBWEBSOCKETS that I missed 2017-09-16 01:25:47 +02:00
ejurgensen
ef6f465aa8 [httpd_jsonapi] Add missing include 2017-09-16 00:10:26 +02:00
chme
0abf195347 [httpd/json] Add json api to httpd 2017-09-15 07:07:17 +02:00