50 Commits

Author SHA1 Message Date
Eamonn Rea
2068b0515f 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-18 19:06:23 +02:00
Tobias Fella
8207b6af08 Update Tobias' mail address 2023-02-27 19:18:46 +01:00
Bart De Vries
eedfc28f8f Handle stream redirects through qt rather than libVLC/gstreamer
libVLC has a hardcoded maximum number of redirects. Several podcasts
need more than this number.  Therefore we resolve the final url through
QNetworkReply and send the final url to the audio player.
2023-02-23 18:37:52 +01: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
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
de954f644a Fix issues with cached images being accessed while the download is still running 2021-10-06 19:16:06 +00:00
Bart De Vries
c061a01c59 Wrap feed update routine in KJob and make it more efficient
The feed update routine which is now spread over several methods
in Fetcher, is now put into a self-contained KJob.  This will allow
to re-use this job later on in e.g. gpodder sync, where it's
required to update feeds before syncing episode statuses.

This also makes the feed update abortable.

Lastly, but most importantly, the feed update procedure has been
optimized to minimize database transactions, resulting in a dramatic
speed-up.  This is especially true for importing new feeds, which
will now be at least 5x faster on slow hardware.
2021-10-01 22:36:42 +02:00
Swapnil Tripathi
a141cda44a Add chapter marks 2021-09-21 20:36:54 +00: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
Tobias Fella
fa1c308c2d Add model for searching for podcasts 2021-07-07 12:57:45 +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
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
a24fb7d731 Get correct enclosure file size as soon as possible when download starts 2021-06-11 16:59:03 +02:00
Bart De Vries
d24b7ed7d0 Write downloads to disk and enable download resume
This enables the download method in Fetcher to resume in case a partial
download is already saved to disk.
For full implementation of download resumes, more changes are required,
because the current application will automatically clean up files that
don't match the expected size at startup.
2021-06-11 16:59:03 +02:00
Bart De Vries
1b1654d1f4 Apply clang-format 2021-05-01 21:35:37 +02:00
Bart De Vries
d1618943f5 Update based on review by Tobias Fella 2021-05-01 21:09:07 +02:00
Bart De Vries
f2c6c3fae2 Avoid race condition when adding feed
When adding a feed and simultaneously starting a feed update, a race
condition could happen where the feed update would catch up with the
feed adding, and start adding and marking old episodes as new before
the original addFeed method would reach them.
2021-04-26 16:58:22 +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
cac0a8b8b6 Adapt signature of error signal
This will be needed for future error logging.
2021-04-21 14:53:03 +02:00
Bart De Vries
695baf9cbb Add fetch function that can take a list of urls 2021-04-21 14:53:03 +02:00
Bart De Vries
53e2560796 Implement backend for feed update progress 2021-04-21 14:53:03 +02:00
Bart De Vries
a45351e1de Make entry models only update if something really changed 2021-04-21 14:53:03 +02:00
Bart De Vries
3a4cdbfec0 Implement limited number of new entries for new feed 2021-04-21 14:53:02 +02:00
Bart De Vries
5d6f05e55e Update copyright headers 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
0aa9e91f19 Add support for additional itunes tags
Most of the itunes fields are used as backup for non-existent regular
fields.
One exception is the entry image, which only exists in itunes tags.
2021-04-21 14:53:02 +02:00
Bart De Vries
0808d3b5fe Almost done with complete refactoring (no queue yet) 2021-04-21 14:52:33 +02:00
Tobias Fella
e5837425d3
Support podcasts 2021-03-22 23:33:44 +01:00
Tobias Fella
7d75c6cf9b Make more things const & 2020-11-01 13:18:11 +01:00
Tobias Fella
db30f159c4 Convert license headers to SPDX 2020-08-14 20:57:40 +02:00
Tobias Fella
87ddc41f32 Notify when image finished downloading 2020-07-04 23:29:46 +02:00
Tobias Fella
d59a1ef1ec Expose network errors to qml 2020-07-02 21:57:09 +02:00
Tobias Fella
237a6d67ed Set user agent 2020-07-02 19:14:07 +02:00
Tobias Fella
a5a449c08b Implement FeedDetailsPage 2020-06-06 00:05:46 +02:00
Tobias Fella
22e766f214 Implement pull-down refreshing in FeedListPage 2020-05-31 18:19:41 +02:00
Tobias Fella
dc384c598e store link, description, authors for feed 2020-05-30 17:33:08 +02:00
Tobias Fella
8269cb960f Refactor models 2020-05-26 16:32:32 +02:00
Tobias Fella
a8fb481631 Expose Fetcher as QML Singleton 2020-05-19 20:37:51 +02:00
Tobias Fella
d68d44faa8 Refactor file download 2020-05-18 21:20:23 +02:00
Tobias Fella
b338f017c9 Make functions more generic 2020-05-18 21:00:05 +02:00
Tobias Fella
1129d4c0f2 Store Enclosures 2020-05-18 17:02:46 +02:00
Tobias Fella
fc1f5ef378 Refactor Fetcher 2020-05-18 16:47:12 +02:00
Tobias Fella
14d8819fb5 Delete image when deleting feed 2020-04-26 23:40:09 +02:00
Tobias Fella
7328745bef Cache images and correctly save relative image paths 2020-04-25 22:16:19 +02:00
Tobias Fella
eb8d24e28a port models to QSqlTableModel 2020-04-18 21:07:49 +02:00
Tobias Fella
5ae34b56f7
Initial Commit 2020-02-28 23:25:08 +01:00