mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Add option to delete media (#1014)
## Description Adds a setting to enable "Media management" which adds a context menu item to delete media. This is accessible using either the More button or long clicking. You can delete episodes, seasons, series and movies/videos. If order for the option to appear the current user must have server-side settings for "Allow media deletion from" enabled for the library and the in-app setting under Settings->Advanced Settings->"Show media management options". ### Related issues Closes #104 ### Testing Emulator ## Screenshots ### Context menu  ### Confirmation  ## AI or LLM usage None
This commit is contained in:
parent
0b73b4cf64
commit
8935067c5a
19 changed files with 597 additions and 53 deletions
|
|
@ -166,6 +166,22 @@ class ApiRequestPager<T>(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps the cache for all the pages at or after the given position and fetches a new page
|
||||
*/
|
||||
suspend fun refreshPagesAfter(position: Int) {
|
||||
val pageNumber = position / pageSize
|
||||
cachedPages.asMap().apply {
|
||||
keys.forEach { pageKey ->
|
||||
if (pageKey >= pageNumber) {
|
||||
if (DEBUG) Timber.v("refreshPagesAfter: dropping %s", pageKey)
|
||||
remove(pageKey)
|
||||
}
|
||||
}
|
||||
}
|
||||
fetchPageBlocking(position, true)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val DEBUG = false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue