### Description
Make sure to close all streams and cursors, enable spotbugs
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Reduce number of database queries. Instead of loading queue and
favorites lists in separate queries, let sqlite do the join
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Remove the explicit disableWriteAheadLogging() call in
PodDBAdapter.openDb(). Without WAL, SQLite allows only one connection at
a time, forcing all threads to serialize on a single lock. When multiple
UI fragments (ExternalPlayerFragment, CoverFragment,
ItemDescriptionFragment, PlaybackHistoryFragment) simultaneously query
the database on separate RxJava IO threads, the resulting lock
contention on the same monitor exhausts the ART monitor inflation limit,
causing a fatal crash (monitor.cc:1125).
Fixes#8338
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Build media item stub in main thread and full item in background thread.
We later plan to add more things to load to the main item creation code,
which should not run on the main thread.
Contributes to #8261
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Re-implement delete after playback in the new playback service. To avoid
a race condition (that we already had in the old playback service), we
have to replace `setMedia` in `deleteFeedMediaSynchronous` with a new
`setMediaDownloadInformation`. Otherwise, we might reset the position
but then it gets overwritten again by deletion setting all attributes.
Closes#8285
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
This no longer makes sense with tags always at the top,
users can always create their own main list.
After we remove the side navigation, we can remove the tag setting.
We check the feed id and the item id when removing from favorites.
However, the item ids are unique, so there is no need to check the feed id.
Actually, I have no idea why it was even added there in the first place.
Now that we have users who somehow ended up with a database where
they cannot un-favorite some of the items, removed the check.
Also make sure to clear the favorites table when deleting a feed.
We already added the queue to the auto-download candidates.
Now that auto-download was rewritten to not be a "master switch",
the code is called even if auto-download is turned off for all subscriptions.
This lead to queued episodes being downloaded for users who had auto-download disabled.
Convert the feature to an explicit setting to avoid behavior changes for users.
Also, this implements a setting to auto-download the queue,
which users have requested because they did not know that AntennaPod already does this.
Finally, it should solve user confusion where they automatically add episodes to the queue
but set the auto-download filter to ignore specific episodes.
We used "GROUP BY" without specifying which item in the group to take.
Apparently, SQLite then takes a deterministic item
instead of the first (randomly sorted) item.