After setting QDateTime to invalid state, it's saved into database as uint,
with then is read from database as a valid date. To make behaviour consistent, this change is needed.
If date is 4294967295, then it's an invalid one.
Not sure this can really happen in real life (happens because I was playing with
the code and end up having "=true" line in Clementine.conf) but FWIW, better
to check those values they come from possibly corrupted files/preferences.
result item not the first item anymore) so we should call it only once at
the beginning.
And instead of sorting all items everytime, we just insert them at the correct
position.
When an async moodbar load completes, it checks to see if the song is still playing and should update the UI.
It however failed to check if the song was stopped, so it would load a moodbar when no song is playing.
It now checks the player state before emitting a change.
Fixes#4663
When tearing down the pipeline, there was a leak of a GstBus which holds a socketpair open.
Eventually the OS runs out of file descriptors and terminates Clementine.
Fix the parsing of some strange date formats in podcasts, and add a way to limit the number of podcast episodes shown, and hide listened podcasts. Fixes#3696, fixes#3475
BTW the compare was buggy (didn't compare against song2). This was OK though, as
we stable sort songs, and they are always ordered as far as I know (I remember
adding this sort just in case they will not be sent ordered on day).
Each time the song is changed, the podcast backend checks whether the
new song is a podcast and, if so, mark it as listened to. This requires
1-2 db queries, so do it off the main thread.
Time to change song before: 300 ms
after: 50 ms usually, 80 ms sometimes
When starting clementine, each playlist is loaded in turn.
When loading a playlist, the new tab order is committed to the db,
but we don't need to do that here because we know that once all the
playlists are loaded the tab order will be the same as it was initially.
This speeds startup substantially.
kstartperf:
Before: 3.5s
After: 1.5s
The playlist fetching uses QtConcurrent to make the playlist on a
different thread (possibly concurrently for each item).
However, profiling reveals that the slow operation is fetching
the rows from the SQLite database, making this redundant.
Instead move the whole playlist loading, including the database access,
into a single function, and call that function in a different thread via
QtConcurrent::run.
This has the side effect of moving all the concurrent stuff from
PlaylistBackend into the callers.
kstartperf measures:
Before: 7.5s cold
3.6 s warm
After: ~4.0 s cold
3.5 s warm
Shouldn't change anything in practice, but better to have items correctly inserted as Internet items FWIW. And will avoid other "custom context menu not working" issues if one day we implement one for
these services.
A bit more information:
Normal transcoding worked fine, the transcoder object was in the main thread. In the network remote, a new transcoder object is created which runs in the network remote thread. When a song was transcoded there, the UI became unresponsive.
Removing the async bus callback solved the problem, exactly the g_source_remove() method caused it. Since the bus callback returned FALSE (GST_BUS_DROP), the watch was already removed. (See http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html#gst-bus-add-watch)
- It is configurable in the settings.
- Any format can be chosen that is supported by the transcoder.
- The status of the transcoder is send to the remote.
- Transcoder format settings have now a postfix so we can define mutliple transcoder formats and use them separatly. Here one for the normal transcoder and one for the network remote transcode. You can pass the postfix in the constructor.
- Fixed Transcoder crash (was introduced with the gstreamer1.0 merge, decodebin doesn't have a "new-decoded-pad").
- Transcoder emits the output filename as well on "JobComplete" signal
- Transcoder can now convert a file to a temporary file ("AddTemporaryJob")