Commit Graph

3229 Commits

Author SHA1 Message Date
ejurgensen
8e7c47cce9 [httpd_daapd] Refactor daap 2017-11-11 22:20:09 +01:00
ejurgensen
50638223ac [dmap] Add a function able to make generate dmap errors without also sending them 2017-11-11 22:20:09 +01:00
ejurgensen
b710d728f8 [db] Add a free_query_params function 2017-11-11 22:20:09 +01:00
ejurgensen
75b14b85e9
Merge pull request #435 from wolfmanx/mpd-argument-unquoting
[mpd] Quoted argument unescaping fixed
2017-11-11 10:04:57 +01:00
ejurgensen
430d3f9f41
Merge pull request #437 from wolfmanx/mpd-password
[mpd] password command
2017-11-11 08:25:02 +01:00
Wolfgang Scherer
c48b819170 [mpd] password command 2017-11-10 09:55:44 +01:00
ejurgensen
5c3f1e9263 [filescanner] Fixup code style 2017-11-10 00:09:31 +01:00
Wolfgang Scherer
16fa1e77b2 [scan] Configuration option to follow symlinks 2017-11-09 01:16:44 +01:00
Wolfgang Scherer
5a960a3450 [mpd] Quoted argument unescaping fixed 2017-11-08 23:03:32 +01:00
Wolfgang Scherer
540d771648 [pulseaudio] allow specification of pulseaudio server 2017-11-05 19:33:14 +01:00
ejurgensen
04dc5956ed [mpd] Fix crash-on-exit because evconnlistener_free() doesn't ignore NULL pointers (issue #430) 2017-10-30 23:07:10 +01:00
ejurgensen
b7f5070ad3 [httpd_dacp] New fix attempt for issue #423 - revision number handling
Commit 190e37e was wrong, we can't just update revision number every time, we
should not do it when we are called with 0 or 1 as revision-number. In those
cases we must return the revision number the client should use, which should
either be the current pending (if other clients are waiting) or the number
following what was used last time we were called with > 1 rev num.

Hopefully this fixes Hyperfine issues.
2017-10-30 20:16:34 +01:00
ejurgensen
79b2cf4fd7 [db] Log path to db on error, so it's easier to debug 2017-10-29 22:07:58 +01:00
ejurgensen
0c9a23e8d2 [pairing] Better log messages for failed pairing attempts 2017-10-28 21:23:21 +02: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
ejurgensen
b64d282f32 [artwork] Fix for issue #427, some embedded file artwork not showing
Artwork in embedded files not showing up in non-legacy mode if the artwork does
not require rescaling. The bug is that we are by mistake sending a chunk of the
embedded file, not the artwork in it.
2017-10-27 19:51:37 +02:00
ejurgensen
66a46173fa [httpd_daap.c] Improve user_agent_filter() code
E.g. remove hardcoded values of DATA_KIND_x
2017-10-21 19:19:51 +02:00
ejurgensen
2beb2fc4cf [httpd_dacp] Fixup temp log line 2017-10-20 22:46:00 +02:00
ejurgensen
190e37e537 [httpd_dacp] Fix bug where not always increasing revision number (issue #423)
The bug affected Hyperfine Remote, which would not call back with a playstatusupdate
when it got a cmsr which had the same value as the previous (a value of 2)
2017-10-20 22:28:31 +02:00
ejurgensen
a94fda38cc [mpd] Some minor fixup 2017-10-20 19:49:17 +02:00
ejurgensen
64dd6b93da [filescanner] Add missing timestamp update in itunes scanner 2017-10-17 23:12:30 +02:00
ejurgensen
e9e8567e8c [filescanner] Make sure to split in transactions even when playlist tracks are unknown 2017-10-17 23:12:30 +02:00
ejurgensen
2d54d0d8fe [filescanner] More alignment of iTunes scanner with the playlist scanner
I.e. use transactions and don't scan unmodified files
2017-10-17 23:11:31 +02:00
ejurgensen
bf8fa1c3f0 [db] Remove poorly performing and now unused _bymatch() functions 2017-10-17 23:11:31 +02:00
ejurgensen
322abb8274 [filescanner] Copy playlist scan optimisations to itunes scanner 2017-10-17 23:11:31 +02:00
ejurgensen
3520ab030e [filescanner] Fix wrong param in filescanner_playlist.c 2017-10-17 23:11:31 +02:00
ejurgensen
a57f7fc188 [httpd_dacp] Clean up code, remove dead stores 2017-10-17 23:11:31 +02:00
ejurgensen
1070f507a2 [filescanner] Add some const's and various fixup 2017-10-17 23:11:31 +02:00
ejurgensen
78dd8c89b6 [filescanner] Log message modifications 2017-10-17 23:11:31 +02:00
ejurgensen
00b7b97382 [db] Make I_FNAME index case insensitive and search fname using COLLATE NOCASE
Also some cleaning up
2017-10-17 23:11:31 +02:00
ejurgensen
88a565ea2c [db] Replace sqlite3_xxx() calls outside db.c/cache.c so they are abstracted 2017-10-17 23:11:31 +02:00
ejurgensen
659b5c70c4 [db] Faster size check in db.c's db_snprintf() 2017-10-17 23:11:31 +02:00
ejurgensen
47585d0d03 [db] Add methods db_mprintf() and db_snprintf() which wrap sqlite 2017-10-17 23:11:31 +02:00
ejurgensen
4d47307a02 [db/filescanner] Add index on fname, change playlist matching (wip) 2017-10-17 23:11:31 +02:00
ejurgensen
45bd2d6cc8 [filescanner] Protect URL items in playlists from purge after scan 2017-10-17 23:11:31 +02:00
ejurgensen
65b4c579f3 [db] Add method db_pl_ping_items_bymatch() 2017-10-17 23:10:21 +02:00
ejurgensen
b9621102f4 [db] Remove db_file_stamp_bypath(), not required any more 2017-10-17 23:10:21 +02:00
ejurgensen
4928d2c155 [spotify] Replace db_file_stamp_bypath with db_file_ping 2017-10-17 23:10:21 +02:00
ejurgensen
d6b30f5a64 [spotify] Add MEDIA_KIND_MUSIC and move DATA_KIND_SPOTIFY 2017-10-17 23:10:21 +02:00
ejurgensen
c8edd2ff64 [spotify] Use db_file_ping_bypath() + refactor + fix small memleak
Align with other scanners to use 1-query db_file_ping_bypath(). Also refactor to
reduce indent level and fix memleak of mfi->album + mfi->album_artist.
2017-10-17 23:10:21 +02:00
ejurgensen
10bd30c036 [filescanner] Update playlist scanner to use db_file_ping_bypath() to save queries 2017-10-17 23:10:21 +02:00
ejurgensen
fa2b4b810f [filescanner] Reduce number of queries during scan
Instead of SELECT'ing timestamp and then UPDATE'ing with a ping if file is
unchanged, skip the SELECT and just do a conditional UPDATE.
2017-10-17 23:10:21 +02:00
ejurgensen
fe731c0993 [db] Add new method db_file_ping_bypath() + cleanup malloc->calloc and char->const char 2017-10-17 23:10:21 +02:00
ejurgensen
95121e7157 [filescanner] Improve playlist scan speed with transactions (WIP - not working for URL's) 2017-10-17 23:10:21 +02:00
ejurgensen
0c2773039b [-] Fix alsa.c null pointer deref + some minor bugs and do some housekeeping
Thanks to Denis Denisov and cppcheck for notifying about the below. The leaks
are edge cases, but the warning of dereference of avail in alsa.c points at
a bug that could probably cause actual crashes.

[src/evrtsp/rtsp.c:1352]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/httpd_daap.c:228]: (error) Memory leak: s
[src/library.c:280]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/library.c:284]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/library/filescanner_playlist.c:251]: (error) Resource leak: fp
[src/library/filescanner_playlist.c:273]: (error) Resource leak: fp
[src/outputs/alsa.c:143]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/alsa.c:657]: (warning) Possible null pointer dereference: avail
[src/outputs/dummy.c:75]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/fifo.c:245]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/raop.c:1806]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/raop.c:1371]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/outputs/raop.c:1471]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/outputs/raop_verification.c:705] -> [src/outputs/raop_verification.c:667]: (warning) Either the condition 'if(len_M)' is redundant or there is possible null pointer dereference: len_M.
2017-10-05 22:13:01 +02:00
ejurgensen
1c377035f1 [raop] Restore ATV4/tvOS11 support by removing needless requirement for timing_port (closes #422) 2017-09-26 21:41:53 +02:00
ejurgensen
c75097b02e [transcode] Log pix_fmt by name instead of enum 2017-09-17 00:00:24 +02:00
ejurgensen
eec98e3b7e [main/transcode] Fix some libav compability + log what ffmpeg/libav we are using 2017-09-16 23:01:42 +02:00
ejurgensen
7cc9a8b02b [httpd] Fix unused label when compiling without libwebsockets 2017-09-16 17:01:51 +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
ejurgensen
f8c442ba38 [configure] Change so we enable/disable websockets based on libwebsockets >= 2.0.2 presence 2017-09-16 00:05:50 +02:00
ejurgensen
546362980b Merge pull request #408 from chme/web
Add a web api and a webinterface
2017-09-15 23:15:49 +02:00
chme
da2e998c8d [listener] fix typo in comment for stored playlists 2017-09-15 18:49:04 +02:00
chme
ecfea82234 [httpd/spotify] Redirect to admin.html, remove old oauth interface 2017-09-15 18:49:04 +02:00
chme
2c51c6571a [misc] Add websocket to buildopts 2017-09-15 07:16:41 +02:00
chme
75eb5420fd [httpd/websocket/conf] Initial websocket implementation
If enabled (default) requires libwebsockets >= 2.0.2, can be disabled
with configure option --disable-websocket.
2017-09-15 07:14:08 +02:00
chme
0abf195347 [httpd/json] Add json api to httpd 2017-09-15 07:07:17 +02:00
chme
42b644020d [conf] Add "websocket_port" to config file 2017-09-15 07:04:18 +02:00
chme
f1e706ee8f [httpd] Allow browsers to cache static files
Setting the response headers "Cache-Control" and "Last-Modified" results
in clients being able to cache the response. For a subsequent request
for the same file, the browser sets the request header
"If-Modified-Since" with the value from "Last-Modified" from the last
response. The server (httpd.c) checks if the file has been modified and
if not returns HTTP 304 Not Modified.
2017-09-15 07:01:53 +02:00
chme
5d5ed42749 [main/misc] Add misc-function to retrieve enabled buildoptions 2017-09-15 07:01:53 +02:00
chme
a04604f693 [logger] New logdomain L_WEB for websocket/jsonapi implementation 2017-09-15 06:56:24 +02:00
chme
9275f7a938 [httpd] Expose function for authenticating admin requests 2017-09-15 06:56:24 +02:00
chme
1d49413070 [httpd/conf] Fix serving files from WEB_ROOT folder and enforce setting
the admin password

Changes the default for the admin password to be unset, by default only
allowing access to the WEB_ROOT files if accessed from localhost.
2017-09-15 06:56:24 +02:00
chme
9b84150f6e [misc_json] New function jparse_obj_from_evbuffer 2017-09-15 06:42:21 +02:00
chme
89fc1fa5b8 [misc/spotify] Move json helper functions into its own file 2017-09-15 06:42:21 +02:00
chme
a832e40bea [spotify] Add function spotify_login_user 2017-09-15 06:42:21 +02:00
chme
29c0264444 [spotify] Add spotify status info and notify about status changes 2017-09-15 06:42:21 +02:00
chme
7bf6aec3a6 [listener] New event type for spotify status changes 2017-09-15 06:42:21 +02:00
chme
f449204ea2 [spotify] Add support for calling sp_session_user_name 2017-09-15 06:42:21 +02:00
chme
4b49ce69e2 [pairing/listener] Add function to retrieve name of remote and notify
about start and finish of remote pairing requests
2017-09-15 06:42:21 +02:00
ejurgensen
400f4ef3ee [main] Fix typo 2017-09-08 08:19:49 +02:00
ejurgensen
c27448418c [httpd/mpd] Make sure daemons listen on both ipv4 and ipv6 if enabled
Before setting ipv6 = enabled on FreeBSD would make the daemon not listen on ipv4
2017-09-07 23:14:18 +02:00
chme
ae446046f5 [mpd] Notify mpd clients on library update events 2017-08-27 11:54:32 +02:00
chme
f81d33701b [listener/library] Notify listeners about start/finish of library update 2017-08-27 11:54:32 +02:00
chme
0b2ee5a9eb [db/mpd] Simplify getting file count from db 2017-08-27 11:54:32 +02:00
ejurgensen
c45a85d143 [dacp] Fix issue where Hyperfine Remote provides speaker ids as decimal
Also align a bit on how we handle hex/dec parameters
2017-08-27 00:02:39 +02:00
ejurgensen
1b8adc11ed [dmap] Use a wrapper for dmap_find_field()
Avoids the need to have definition of dmap_find_field in dmap_common.h that
must be kept in sync with the definition that gperf generates.

Also should fix compilation problems when gperf is not present, ref pr #390
2017-08-25 19:27:41 +02:00
ejurgensen
43abb18e4e [transcode] Fix illegal write when *icy_timer is null (fixes issue #412) 2017-08-20 23:08:36 +02:00
ejurgensen
2d3d641f41 Merge pull request #413 from chme/realpath
[misc] Replace m_realpath with realpath from stdlib.h
2017-08-12 21:52:30 +02:00
chme
14877a49e0 [misc] Replace m_realpath with realpath from stdlib.h 2017-08-12 13:35:22 +02:00
chme
d477294809 [filescanner] Guard against modifying files outside the library and
guard against creating m3u playlists with the same virtual path like pls
playlists
2017-08-12 10:22:18 +02:00
chme
8f49a6fb45 [mpd/conf] Add config option to enable modifying stored playlists 2017-08-12 10:16:07 +02:00
chme
dc3f9443e7 [mpd/conf] Add support for stored playlist commands (add/save/delete)
This also introduces a new config option to define a default playlist
folder. The default playlist folder is used by forked-daapd if the
playlist is not a full virtual path (simpifies creation of playlists
with mpd clients).
2017-08-09 21:41:32 +02:00
chme
d10c3672c6 [filescanner] Add support to save/add/delete local stored playlists
Allows creating/modifying of playlists in one of the configured library
directories.
2017-08-09 21:41:32 +02:00
chme
f84e87913c [library] Allow save/add/delete of playlists if source supports it 2017-08-09 21:30:23 +02:00
chme
ff4b388d26 [db] Use db_get_one_int in db_pl_id_bypath 2017-08-07 20:13:46 +02:00
ejurgensen
a975dabded [artwork] Re-apply commit ef13abe to artwork_legacy.c 2017-08-07 00:09:27 +02:00
ejurgensen
e489f1a6a9 [configure] Use avcodec_parameters_from_context as check for codecpar 2017-08-06 22:31:43 +02:00
ejurgensen
394dee2a86 [raop] Log src and dst ip addresses (checking for ipv6, not sure it is allowed) 2017-08-06 22:31:43 +02:00
ejurgensen
548d9ada2e [transcode] Fixup dead assignment 2017-08-06 22:31:43 +02:00
ejurgensen
c13ed8761a [trancode/artwork] Put back compability with older versions of ffmpeg/libav 2017-08-06 22:31:43 +02:00
ejurgensen
f9375ef915 [transcode] More adjustments for libav 12 2017-08-06 22:31:43 +02:00
ejurgensen
6951639d24 [transcode] Adjustments for libav 12 2017-08-06 22:31:43 +02:00
ejurgensen
441ad006a6 [artwork/transcode] Also let transcode.c handle rescaling of non-file Spotify artwork 2017-08-06 22:31:43 +02:00
ejurgensen
e7f888645f [artwork/transcode] Adjust transcode.c so it can take care of artwork
rescaling, meaning we can do without parallel ffmpeg interfaces.
This also moves artwork rescaling from libswscale to libavfilter, which
seems to fix a problem with PNG rescaling.
2017-08-06 22:31:43 +02:00
ejurgensen
d933e171d4 [filescanner_ffmpeg] Update to use ffmpeg's new stream->codecpar
- keep some compability with older ffmpeg/libav, but also remove some
2017-08-06 22:20:44 +02:00
ejurgensen
1e180b5ce8 [transcode] Call av_write_trailer before cleanup so that any flushed data
will be written to encode_ctx->obuf, where it can be passed to the caller
2017-08-06 22:20:44 +02:00
ejurgensen
e96b9500db [transcode] Implement new ffmpeg decoding methods: avcodec_send_packet/avcodec_receive_frame 2017-08-06 22:20:44 +02:00