Commit Graph

4378 Commits

Author SHA1 Message Date
ejurgensen
c293f72846 [httpd] Fix for musl libc not having sys/queue.c (closes #1726) 2024-03-03 22:41:25 +01:00
ejurgensen
49de0240b8 [scan] Remove obsolete comments 2024-03-01 23:37:17 +01:00
ejurgensen
4352f54c11 [scan] Use copy_file_range for Linux/FreeBSD file copy
FreeBSD doesn't seem to actually have copyfile.h
2024-03-01 22:59:23 +01:00
whatdoineed2do
2dc448fa30
[scan/library] Media rating sync (#1681)
Automatically read/write ratings to files in the library, if options read_rating/
write_rating are enabled. Also adds a max_rating so the user can set the rating
scale.

Doesn't sync automatic rating updates, because that could lead to whole-playlist
file rewriting.

Closes #1678 

---------

Co-authored-by: whatdoineed2do/Ray <whatdoineed2do@nospam.gmail.com>
Co-authored-by: ejurgensen <espenjurgensen@gmail.com>
2024-01-24 23:30:02 +01:00
ejurgensen
b4e4583e61 [raop] Remove unused function 2024-01-18 18:18:33 +01:00
ejurgensen
74c82141d4 [artwork] Remove errors in log saying "Source 'stream' returned an error..."
Handler for stream doesn't support URL's with "file:", so ignore any such URLs.
2024-01-12 23:04:59 +01:00
ejurgensen
b6ad73e1fa [xcode] Go back to wav as default format for RSP/DAAP transcoding
But add "prefer_format" config option for mp3, incl. a check for an encoder.
The config option is currently not added to owntone.conf.in, so is undocumented
until decided what to do about possible alac support.
2024-01-01 23:22:30 +01:00
ejurgensen
2871a03aa8 [spotify] Fixup commit 182255c 2024-01-01 17:34:07 +01:00
ejurgensen
61bae6367d [spotify/rtp] Remove some unused functions
Closes #1705
2024-01-01 16:37:15 +01:00
ejurgensen
182255cac8 [spotify] Fix double free on logout or exit
Fixes #1706
2024-01-01 16:33:12 +01:00
ejurgensen
e03120c944 [web] Fix possible invalid read during shutdown
The player may emit a listener event when shutting down, and since websockets
didn't remove it's listener callback it would receive an event despite being
deinitialized. This would lead to an invalid read by lws_cancel_service in
listener_cb().
2023-12-29 17:34:48 +01:00
ejurgensen
c28d108b96 [raop] Fix crash when keys of incorrect length are used for legacy pairing
Happens if the user has paied with Airplay 2, and afterwards activates Airplay 1
for the same device, since the keys in device->auth_keys will then be incorrect
length.

Closes #1703
2023-12-28 13:54:52 +01:00
ejurgensen
2fa80b2fd9 [spotify] Remove logging of "No spotify refresh token found"
Logged every time the web UI is used due to call to /api/spotify and during
initscan, but it isn't an error, it just means the user isn't logged in.

Fixes #1701.
2023-12-22 23:29:40 +01:00
ejurgensen
045edf7c55 [httpd] Replace syscall with gettid, syscall deprecated on MacOS 2023-12-19 22:56:58 +01:00
ejurgensen
a7f44dc3e8 [jsonapi] Fix mistaken call to library_media_save
Only library modules should be calling that function
2023-12-19 21:27:31 +01:00
ejurgensen
f430b71645 [jsonapi] Include info about tracks added to queue (closes issue #1564) 2023-12-17 23:42:57 +01:00
ejurgensen
5ea49c94de [library/db/jsonapi] Refactor adding items to queue via JSON API v2 2023-12-17 23:42:57 +01:00
ejurgensen
1ea90b9445 [library/db/jsonapi] Refactor adding items to queue via JSON API
Reduce code duplication and move database specific stuff from httpd_json.c
to db.c.
2023-12-17 23:42:57 +01:00
ejurgensen
cbfce63f4d [db] Use songalbumid's that are distinct for data_kind
Means the same album won't contain both e.g. Spotify and local tracks, they
will instead be shown as two albums.

Ref issue #1650
2023-12-17 21:12:31 +01:00
ejurgensen
f657780a42 [scan] Fix issue where albums get split
Regression from PR #1655. This reverts the metadata search to the method used
before the PR, so that search is done in the order set by the metadata maps.

This means the songalbumid is set by the tag with the highest precedence, not
just the first one found.

Closes #1696
2023-12-16 00:11:54 +01:00
ejurgensen
85e9b06bca [xcode] Produce correctly sized ALAC frames
With ffmpeg < 6, using av_buffersink_set_frame_size() with the codecs frame
size means we no longer the frame size of 352 that Airplay requires.
2023-12-04 17:26:03 +01:00
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
f0df3f276f [library] Remove false log warning 2023-11-25 22:07:50 +01:00
ejurgensen
65c72c484b [misc] Add misc_xml.c to wrap mxml, fixes XML reading of CDATA (et al)
The change removes all direct calls to mxml from the modules that need an XML
parser (lastfm.c, pipe.c, rssscanner.c and httpd_rsp.c).

Even with the help of mxml, reading XML is hard, so a layer is added which
helps deal with stuff like whitespace and CDATA. This should make OwnTone more
resilient to any XML variations it might receive.

The changes fixes issue #1677.
2023-11-12 23:43:38 +01:00
ejurgensen
83ac327d7f [spotify] Don't log error if a playlist is empty
Fixes #1676
2023-10-28 17:38:37 +02:00
ejurgensen
369771bda5 [scan] Handle playlists with Unicode BOM
Closes #1674
2023-10-26 23:03:54 +02:00
ejurgensen
253a699001 [scan] Fix reading of FLAC tags
Regression from PR #1655. Closes #1673.
2023-10-26 22:40:23 +02:00
ejurgensen
e4c47c22b3 [scan] Fix issue where m3u genre doesn't override despite m3u_override = true
Closes #1668
2023-10-21 22:37:34 +02:00
ejurgensen
8796368b01 [scan] Fixup lyrics changes 2023-10-19 23:49:53 +02:00
X-Ryl669
9670f6b079 [httpd] Add fetching lyrics in the JSON api 2023-10-19 23:49:53 +02:00
X-Ryl669
cf8b3ecd3a [db,library] Add support for parsing lyrics and storing them in DB 2023-10-19 23:49:53 +02:00
ejurgensen
d266c8a56f [raop] Make compressed ALAC default, but with a config option
Closes #1656
2023-10-06 21:39:26 +02:00
X-Ryl669
ab790c2880 [mdns] Fix select issue on FreeBSD.
As reported in issue #1654, using select to test for a (non-blocking) connection success crashes on FreeBSD when the number of opened file descriptor is higher than FDSET_SIZE.
Instead of returning with an error in that case, this commit uses poll instead that's not limited to the number of opened file descriptors, preventing an out-of-bound write.
2023-10-02 09:53:06 +02:00
ejurgensen
8528073003 [daap] Fix for use-after-free
Present in 28.7 and 28.8. Closes #1659.

Credit X-Ryl669.
2023-09-30 23:06:09 +02:00
ejurgensen
4662cd4cce [scan] Set consistent return type in check_path_in_directories() 2023-09-27 22:46:13 +02:00
ejurgensen
a9e21dcbfd [main] Add a 'testrun' command line option for Github actions 2023-09-03 21:01:11 +02:00
ejurgensen
3f6c7405ed [spotify] Don't zero pthread lock when resetting credentials 2023-09-03 20:59:45 +02:00
ejurgensen
54c2667aea [misc] Use fcntl+O_NONBLOCK when binding instead of socket+SOCK_NONBLOCK
socket() with SOCK_NONBLOCK (O_NONBLOCK) seems not to be possible on MacOS, it
yields 'Protocol wrong type for socket'. Switch to using fcntl() and O_NONBLOCK
instead, hopefully works better cross-platform.

Closes #1644
2023-09-01 17:13:33 +02:00
ejurgensen
9d092c983b
Merge pull request #1648 from whatdoineed2do/library-overwrite-db-entry-fix 2023-09-01 17:06:44 +02:00
whatdoineed2do/Ray
b9b8ced689 [scan] Handles case for file overwrite/move within library that previously original db entry for overwritten file
Fixes #1645
2023-09-01 09:17:54 +01:00
ejurgensen
447e042953 [raop] Add ALAC end tag to each frame
The missing end tag makes the ffmpeg alac decoder upset and we can't have that

Credit Mike Brady
2023-08-30 21:00:33 +02:00
ejurgensen
4315c73775 [httpd] Fix building on FreeBSD which doesn't have SYS_gettid 2023-08-29 23:50:19 +02:00
ejurgensen
214ef12cb5 [spotify] Fix free of invalid pointer on http request error
Fixes #1643
2023-08-29 20:14:19 +02:00
ejurgensen
941fab9023 [xcode] Circumvent ffmpeg 6 ALAC encoding problem
The default ffmpeg ALAC encoder, "alac", requires fixed frames of size 4096,
but the Airplay 2 implementation feeds it with frames of size 352. Before
ffmpeg 6 this worked, but not any more. Seems a frame size check has been
added.

This commit doesn't fix this, but circumvents the ffmpeg error by modifying the
frame size that ffmpeg checks.

Fixes issue #1640
2023-08-17 23:12:26 +02:00
ejurgensen
7f2e05284b [scan] Read m3u8 playlists like m3u
Fixes #1639
2023-08-15 19:33:50 +02:00
Marek Skrobacki
469fcf6707
[mpd] Sanitize newline characters in ID3 tag values (#1615)
Fixes https://github.com/owntone/owntone-server/issues/1613
2023-08-12 23:57:28 +02:00
ejurgensen
9f67f2d4fd [rss] Use "Unknown genre" instead of "Podcast" if no genre found
If the scanner doesn't set anything the genre will be set to unknown in db.c.

See issue #1618
2023-07-06 14:40:39 +02:00
ejurgensen
f998b1f3dd [streaming] Change how metadata is delivered to http streaming
This gets rid of player locks + the special header file outputs/streaming.h
2023-05-12 22:35:10 +02:00
ejurgensen
6364515fb7 [streaming] Use player_streaming_register() for thread safety
Also means we might be able to drop the special header file for
outputs/streaming.c making it a bit more like a regular output module.
2023-05-11 22:30:36 +02:00
ejurgensen
dedd4a95c2 [player] Add player_streaming_register() and _deregister() 2023-05-11 22:30:36 +02:00