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
![delete_context_2
Large](https://github.com/user-attachments/assets/cabc3c24-1b43-4f88-8d71-b7275f9eadc4)


### Confirmation
![delete_confirm
Large](https://github.com/user-attachments/assets/8036dde1-8a51-424b-bbdd-f2826dd3e0ab)

## AI or LLM usage
None
This commit is contained in:
Ray 2026-03-02 15:38:41 -05:00 • committed by GitHub
parent 0b73b4cf64
commit 8935067c5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 597 additions and 53 deletions

View file

@ -741,6 +741,18 @@ sealed interface AppPreference<Pref, T> {
valueToIndex = { it.number },
)
val ManageMedia =
AppSwitchPreference<AppPreferences>(
title = R.string.show_media_management,
defaultValue = false,
getter = { it.interfacePreferences.enableMediaManagement },
setter = { prefs, value ->
prefs.updateInterfacePreferences { enableMediaManagement = value }
},
summaryOn = R.string.enabled,
summaryOff = R.string.disabled,
)
val OneClickPause =
AppSwitchPreference<AppPreferences>(
title = R.string.one_click_pause,
@ -1110,6 +1122,7 @@ val advancedPreferences =
preferences =
listOf(
AppPreference.ShowClock,
AppPreference.ManageMedia,
AppPreference.CombineContinueNext,
// Temporarily disabled, see https://github.com/damontecres/Wholphin/pull/127#issuecomment-3478058418
// AppPreference.NavDrawerSwitchOnFocus,