Commit Graph

77 Commits

Author SHA1 Message Date
Bart De Vries 9c6c77db7a
Save filters on episode list and episode detail pages
FEATURE: 466792
2024-04-23 09:32:02 +02:00
Bart De Vries 48a10a25cc Clean up the feed addition routine
- Avoid multiple QUrl::toString() calls
- Immediately create the Feed object rather than wait for loadFeed()
2024-04-12 12:49:47 +02:00
Bart De Vries 34f65245bd Speed up feed updates dramatically
Instead of always parsing the entire RSS/atom feed, we keep a hash of
the contents of the feed in the database.  If the hash of the new feed
retrieval matches the hash in the database, we know nothing has changed
and we can skip the detailed parsing of the feed altogether.
2023-10-26 11:19:28 +00:00
Bart De Vries 0e2fbd547a Restructure files: add utils directory 2023-10-26 09:52:23 +02:00
Bart De Vries c3ca038af7 Implement backend to allow Feed list sort and search
The current list of things to sort on (ascending and descending), includes:
- unplayed episodes
- new episodes
- favorite episodes
- title (alphabetical)
For the first three categories, the value of the sort quantity will be shown
in the upper right corner of the delegate.

BUG: 471012
CCBUG: 459885
2023-07-27 09:24:03 +00:00
Bart De Vries 5c8502718a Implement sorting for queue and episode lists
Also move filter action (menu) from the search bar back into the main toolbar.

BUG: 466855
2023-07-26 08:17:23 +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 8b3603eb56 More safeguards for getFeed and getEntry calls 2023-06-18 16:31:42 +02:00
Bart De Vries b529bfc3ca Fix segfault when trying to remove a non-subscribed podcast
BUG: 471107
2023-06-18 15:12:59 +02:00
Bart De Vries 8a9dc0f22f Also delete partially downloaded played episodes on startup
Previously only fully downloaded episodes that had been played
were deleted on startup.
2023-04-24 14:19:43 +02:00
Bart De Vries db234722cb Add implementation for favorites
BUG: 459886
2023-03-23 15:45:06 +00:00
Bart De Vries 45e50e40fb Fix bug with empty feed causing nullptr dereference
If an empty URL was entered (i.e. only whitespace) then that would be
accepted and added to the database as temporary entry to be loaded and
checked later.  However, sqlite will convert this to a NULL entry.  This
would lead to Kasts not being able to retrieve that feed from the DB,
and hence not being able to create a proper object.  This would then
lead to a nullptr dereference down the line.
Note that this is a corner case: other invalid URLs are spotted
correctly and do not cause the application to crash.

BUG: 467394
2023-03-15 15:10:47 +01:00
Bart De Vries d192784e12 Improve check for existing podcasts
The feedExists method will now also take query parameters into account.

BUG: 461877
2022-11-15 19:13:24 +01:00
Bart De Vries c3df8d8714 Fix "database is locked" errors caused by concurrent writes 2022-07-14 15:32:58 +02:00
Bart De Vries 633f4fd0f0 Use multithreading for feed updates (using ThreadWeaver)
This contains the following changes:
- Use separate db connections for feed updates (required for
  multithreading.
- Add ThreadWeaver dependency.
- Port update job from KJob to ThreadWeaver::Job
- This should also solve the bug where the update process would hang
  on the "processEvents" call, which was intended to keep the UI
  responsive during updates.

BUG: 452585
2022-05-29 15:22:23 +02:00
Bart De Vries 2b363b6cec Add new episodes to queue in ascending chronological order
Fixes #32
2022-05-24 22:27:20 +02:00
Bart De Vries bbded05933 Keep unreadEntryCount cached instead of getting it from DB everytime 2022-03-10 08:03:00 +01:00
Bart De Vries 1fb0e0fc45 Fix bug in addFeeds
addFeeds would stop if it encountered a url that we already had in the
database instead of continuing with the next one.  This bug was
introduced due to refactoring for sync.
2021-11-19 10:32:00 +01: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
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
Bart De Vries e4ee0f19fd Do not create feed object if it's not in the database
Also clear errors related to a feed that's being removed from the database.
2021-10-01 15:46:17 +02:00
Bart De Vries 8900186990 Fix crash on multi-selection download/delete action
Solves #16
2021-09-23 13:17:53 +02:00
Swapnil Tripathi a141cda44a Add chapter marks 2021-09-21 20:36:54 +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 bb8cd2807c Refactor EpisodeModel and DownloadModel to make them more performant 2021-09-18 19:07:15 +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
Swapnil Tripathi 95ee97aefe Expanded the model with more roles and designed frontend. 2021-07-07 12:57:45 +02:00
Bart De Vries fe2a977a6b Add setting to automatically delete episodes when they're marked as played
The 3 possibilities are:
0 = Disabled      = Do not delete episodes
1 = Immediately   = Delete immediately
2 = OnNextStartup = Delete on next startup (default)

Fixes #14
2021-07-06 22:34:26 +02:00
Bart De Vries 1b3df48ce8 Solve TODO: unload entry from audio player when it's removed from the queue 2021-07-04 16:51:47 +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 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 14868bf04e Apply clang-format 2021-06-19 13:29:47 +02:00
Bart De Vries 0b8c1856c9 Mark episode as unread when adding to queue 2021-06-08 14:19:50 +02:00
Bart De Vries 2ed33aa750 Add debugging logging categories 2021-06-05 22:03:22 +02:00
Bart De Vries 9d78b5b488 Run clang-format 2021-05-28 23:16:35 +02:00
Swapnil Tripathi 21e9d0b9a7 Fix segfault when removing feeds with currently playing entries 2021-05-22 09:05:33 +00:00
Bart De Vries 9c83ee08e8 Show BusyIndicator on newly added feeds until they have finished updating 2021-05-08 16:13:28 +02:00
Bart De Vries 236c579bef Enable setting for automatic download of new episodes 2021-05-07 22:19:02 +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 4aa2f14eb7 Apply 50 suggestion(s) to 19 file(s) 2021-05-01 18:59:08 +00:00
Bart De Vries 28d6f7f525 Fix compiler warnings 2021-04-22 11:00:17 +02:00
Bart De Vries 73c333cf61 Add possibility to delete feed from entrylistpage 2021-04-21 14:53:03 +02:00
Bart De Vries 02340ec362 Overload addFeed 2021-04-21 14:53:03 +02:00
Bart De Vries 295b98a903 Refactor import feeds to be able to show progress 2021-04-21 14:53:03 +02:00
Bart De Vries 6a256baa18 Disable more debug output
Disable in fetcher and datamanager
2021-04-21 14:53:03 +02:00
Bart De Vries ae13eb8cfd Begin refactoring feed updating routines for speed
Make sure that property change signals are only emitted when something
has really changed.  So far part "feed" has been done.  Entries,
enclosures and entry authors still need to be done.
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