Commit Graph

53 Commits

Author SHA1 Message Date
Bart De Vries c09925c59f
Refactor conversion from enum to int and vice versa 2024-04-23 11:19:36 +02:00
Bart De Vries 50bdc5551c Add check for invalid embedded images
Some enclosures have non-empty embedded images which are not pictures.
This add a check which discards those, and then falls back to a valid
image.

BUG: 480263
2024-01-24 13:26:20 +00:00
Bart De Vries 52a1f08e02 Add a switch to globally enable/disable network status checks
Make error reporting less ambiguous: report either "no connection" or
"not allowed on metered connection".  Also show hint how to disable
network status checking altogether.

BUG: 475400
2023-11-07 21:06:19 +00:00
Bart De Vries 0e2fbd547a Restructure files: add utils directory 2023-10-26 09:52:23 +02:00
Bart De Vries a77a312533 Give priority to image embedded in audio file if it exists 2023-07-22 14:09:03 +00:00
Eamonn Rea dc311cac7b Use Entry title to set downloaded file name
Instead of using the MD5 hash of the enclosure download URL, we
create a filename which follows `feedname/entry_title.hash.ext`, where
feedname is a uniquefied feed title (stored in the DB), a truncated version
of the entry title, a shortened hash based on the download URL, and the
original file extension extracted from the download URL.

BUG: 457848
2023-07-17 14:52:02 +02:00
Bart De Vries 0c54ab7edf Refactor to use QNetworkInformation instead of SolidExtras for Qt6
SolidExtras will still be used for the Qt5 version for the time being.
This refactoring makes it trivial to rip out SolidExtras once the jump
to Qt6-only will be made.
2023-06-02 19:11:10 +02:00
Tobias Fella 8207b6af08 Update Tobias' mail address 2023-02-27 19:18:46 +01:00
Bart De Vries 9b97613898 Fix fallback when no image is available in id3 tag 2022-08-09 10:58:16 +02:00
Bart De Vries e62d17f9b0 Adjust time left on episodes according to current playback rate
This new feature is implemented behind a switch in the settings (default
is off).

FEATURE: 452135
2022-06-01 21:08:27 +02:00
Bart De Vries aac899a7f0 Refactor feed update routine to allow for entry, enclosure, authors and chapter updates
This commit adds a bunch of API extensions (public and private) to the
entry, enclosure, etc classes to allow runtime updates of internal data.
Additionally, the feed update routine has been adapted to find updates
in entries, enclosures, etc and pass them on to the relevant objects.

All of this functionality is put behind a new toggle exposed in the
settings (default is on).  This is useful since a full update takes
quite a bit longer on underpowered hardware, so users should be able to
switch off this potentially non-essential overhead.

BUG: 446158
2022-05-31 16:11:50 +02:00
Bart De Vries b884ac69bf Use embedded image in id3v2tag as fallback 2022-05-23 22:14:48 +02:00
Bart De Vries f861f4e802 Add podcast subscription and episode play state synchronization
This implements the gpodder API from scratch.  It turned out that
libmygpo-qt has several critical bugs, and there's no response to pull
requests upstream.  So using that library was not an option.

The implementation into kasts consists of the following:
- Can sync with gpodder.net or with a nextcloud server that has the
  nextcloud-gpodder app installed.  (This app is mostly API compatible
  with gpodder.)
- Passwords are stored using qtkeychain.  If the keychain is
  unavailable it will fallback to file.
- It syncs podcast subscriptions and episode play positions, including
  marking episodes as played. Episodes that have a non-zero play
  position will be added to the queue automatically.
- It will check for a metered connection before syncing.  This is
  coupled to the allowMeteredFeedUpdates setting.
- Full synchronization can be performed either manually (from the
  settings page) or through automatic triggers: on startup and/or on
  feed refresh.
- There is an additional possibility to trigger quick upload-only syncs
  to make sure that the local changes are immediately uploaded to the
  server (if the connection allows).  This will trigger when
  subscriptions are added or removed, when the pause/play button is
  toggled or an episode is marked as played.
- This implements a few safeguards to avoid having multiple feed URLS
  pointing to the same underlying feed (e.g. http vs https).  This
  solves part of #17

Solves #13
2021-10-29 18:47:55 +02:00
Tobias Fella fc6969e018 Implement network status checking on android
Replaces the whole thing with the solidextras implementation found in
itinerary
2021-10-09 19:32:28 +00:00
Bart De Vries 4b2da3533c Enable multi-selection and context menus on all lists of entries
This commit adds keyboard navigation to entry lists.
Selection of items can be done through keyboard (shift+up/down), mouse
(left, left+shift, left+ctrl) or touch (long press).
When items are selected, contextual actions will show up on
the page (useful for touch screens), or, alternatively, a context menu
with the same actions can be opened through right mouse click (useful
for desktop).
If a single entry is selected, then only the relevant actions will be
shown (e.g. only "Mark as Played" if the entry has not been played yet).

Additionally, (database) transactions for the actions have been
optimized.  This was necessary to make sure that actions on large
selections of entries finish within an acceptable time.  E.g. actions on
a list of 1000 items should finish within a few seconds (on all but
underpowered hardware).

BUG: 441764
2021-09-19 21:37:10 +02:00
Bart De Vries 117f314d0d Move models to dedicated directory 2021-09-18 19:07:15 +02:00
Bart De Vries a15e2dbe5d Make storage path configurable
This adds a new setting to the Settings page.
Existing enclosures and images will be moved to the new location
(first copied, then deleted in the original location).  If any of
the copy actions fail, the operation is aborted and the original
path is restored.
The StorageMoveJob is set up in such a way that it's easy to add other
files or subfolders in the future.

Solves #15
2021-07-24 20:43:11 +02:00
Bart De Vries b9b82d783f Also add title argument to Error elsewhere 2021-07-14 22:32:14 +02:00
Bart De Vries 35cfb14e1f Also show left duration on EntryDelegates if it's been set in the player 2021-07-14 20:31:02 +02:00
Bart De Vries d0bc5b2b26 Add capability to check whether network connection is metered
For now this only works with NetworkManager.  The related settings are
greyed out on systems not using NetworkManager.

Some details of the implementation:
- Implement settings in the settings menu to enable/disable feed
  updates, episode downloads and/ or image downloads on metered
  connections.  If the option(s) is disabled, an overlay dialog is shown
  with options to "not allow", "allow once", or "allow always".
- If the network is down, no attempt is made to download images and the
  fallback image will be used until the network is up again.
  This also solves an issue where the application hangs when the network
  is down and feed images have not been cached yet.
- Next to this, part of the cachedImage implementation in Entry and Feed
  has been refactored to re-use code as part of the image() method in
  Fetcher.
- In case something unexpected happens, an error will be logged.
2021-07-03 20:20:27 +02:00
Bart De Vries bcafb26c8c Add filesize units to download progress
This adds the currently downloaded size and the total enclosure size to
the entry delegate.
2021-06-24 17:12:07 +02:00
Bart De Vries d7debaaf30 Rework Download list page
This page now has section headers, and show Downloading, Partially
Downloaded and Downloaded enclosures with relevant actions for each.
2021-06-24 11:49:24 +02:00
Bart De Vries f197e6ab02 Implement Enclosure::PartiallyDownloaded status
Still to be done:
- Update Download Page to show partial downloads.
- Connect signals to Download Page to update whenever an enclosure
  changes status.  This is broken by this commit because
  downloadCountChanged has been removed.
2021-06-23 23:04:18 +02:00
Bart De Vries 03081edc66 Improve estimate of enclosure download size, also when resuming 2021-06-23 22:29:15 +02:00
Bart De Vries 49977adc38 Refactor Error implementation and add Error::Type
- This refactoring also includes a cleanup of a lot of header includes to
  avoid circular dependencies.
- The error message will now be shown below the info message.
- Add database migration (for Errors)
2021-06-19 17:09:44 +02:00
Bart De Vries 1f35c0a25c Don't clean up partial downloads, such that they can be resumed 2021-06-11 16:59:03 +02:00
Bart De Vries a24fb7d731 Get correct enclosure file size as soon as possible when download starts 2021-06-11 16:59:03 +02:00
Bart De Vries 2ed33aa750 Add debugging logging categories 2021-06-05 22:03:22 +02:00
Tobias Fella 3f1f3045ec Port away from KDeclarative 2021-06-03 16:23:06 +02:00
Bart De Vries 173b86b85d Get rid of downloadStatusChanged in Enclosure
Instead change the signature on statusChanged so it can pass on all
required information instead of needing two signals with separate
signatures.
2021-05-02 09:05:26 +02:00
Bart De Vries 1b1654d1f4 Apply clang-format 2021-05-01 21:35:37 +02:00
Bart De Vries 4aa2f14eb7 Apply 50 suggestion(s) to 19 file(s) 2021-05-01 18:59:08 +00:00
Bart De Vries cbf0d9c622 Comment out some qDebug() statements 2021-04-30 19:13:43 +02:00
Bart De Vries 184ba72208 Safeguard against downloaded enclosures of 0 size 2021-04-29 22:19:34 +02:00
Bart De Vries 5a0972372b Add ErrorModel, just a placholder GUI for now 2021-04-24 23:32:10 +02:00
Bart De Vries a50c8bf001 Add capability to monitor ongoing downloads 2021-04-21 23:09:19 +02:00
Bart De Vries 423409403e Refactor size property in Enclosure
This will make sure that the size is automatically updated in the GUI if
it's corrected based on the real, downloaded audio file.
2021-04-21 14:53:03 +02:00
Bart De Vries 7a900b5921 Update enclosure duration if needed
If the duration that is mentioned in the enclosure doesn't correspond to
the real duration then update to the real duration in the database.
2021-04-21 14:53:03 +02:00
Bart De Vries e9d20ec569 Implement Downloads page
This change includes an update to the database, adding a downloaded
column in Enclosures.
2021-04-21 14:53:03 +02:00
Bart De Vries 97bed3def8 Add playProgress progressbar to entry items in queue 2021-04-21 14:53:02 +02:00
Bart De Vries 8c1295372a Fix enclosure status
Enclosure wasn't checking if file existed on disk.  Hence, if the
enclosure was reporting a file size of 0 (which matches the non-existent
file size, then it would set the status incorrectly to Enclosure::Downloaded.
2021-04-21 14:53:02 +02:00
Bart De Vries b2ba953a33 Mark fully played episodes as read 2021-04-21 14:53:02 +02:00
Bart De Vries 32f01b03bd Enable next button in Player
This functionality has safeguards built in, including a canGoNext
property.
This can be extended with streaming playing in the future.
2021-04-21 14:53:02 +02:00
Bart De Vries f5c20a92e2 Slightly adapt (temporary) debug information from enclosure 2021-04-21 14:53:02 +02:00
Bart De Vries 515064e618 Change enclosure license headers 2021-04-21 14:53:02 +02:00
Bart De Vries ee13a29d10 Add playposition tracking in enclosure 2021-04-21 14:53:02 +02:00
Bart De Vries 7232238d7b Add additional checks after enclosure has been downloaded
The file size in the database will be corrected if it doesn't match the
real file size.
The "new" status will be unset once the file has been downloaded.
2021-04-21 14:53:02 +02:00
Bart De Vries 71c86d5645 Add TODO for enclosure file size check 2021-04-21 14:53:02 +02:00
Bart De Vries 75f8f93da7 Change paths where images and enclosures are saved
Images are now stored in the cache directory in a dedicated subdir
called "images".
Enclosures are stored in the data directory in a dedicated subdir
"enclosures".
2021-04-21 14:53:02 +02:00
Bart De Vries 06bffdb5e3 Add "new" and "playposition" to database
These fields have been added to, respectively, Entries and Enclosures.
2021-04-21 14:53:02 +02:00