Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add media management preference #2415

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

nielsvanvelzen
Copy link
Member

This new preference shows a delete option for items when the user has permissions to delete the displaying item. This is a rewritten implementation of the previous delete option that was removed in 0.15.

Changes

  • Add preference "enable media management"
  • Add "delete" option to item details screen (when management is enabled)
    • Only shows when the user has permission to delete the item
      • Also checks per-library delete permission now
    • Catches issues and shows a toast for it, to prevent crashes when deletion fails
  • Change DataRefreshService.lastDeletedItemId to UUID
  • Item deleted toast is now translatable

Issues

Fixes #2368

@nielsvanvelzen nielsvanvelzen added the enhancement New feature or request label Jan 14, 2023
@nielsvanvelzen nielsvanvelzen added this to the v0.16.0 milestone Jan 14, 2023
@@ -170,8 +170,9 @@
super.onResume()

//React to deletion
if (currentRow != null && currentItem != null && currentItem!!.getItemId() != null && currentItem!!.getItemId().equals(dataRefreshService.lastDeletedItemId)) {
if (currentRow != null && currentItem != null && currentItem?.baseItem != null && currentItem!!.baseItem!!.id == dataRefreshService.lastDeletedItemId) {

Check warning

Code scanning / detekt

Complex conditions should be simplified and extracted into well-named methods if necessary.

This condition is too complex (4). Defined complexity threshold for conditions is set to '4'
@@ -170,8 +170,9 @@
super.onResume()

//React to deletion
if (currentRow != null && currentItem != null && currentItem!!.getItemId() != null && currentItem!!.getItemId().equals(dataRefreshService.lastDeletedItemId)) {
if (currentRow != null && currentItem != null && currentItem?.baseItem != null && currentItem!!.baseItem!!.id == dataRefreshService.lastDeletedItemId) {

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style.

Line detected, which is longer than the defined maximum line length in the code style.
The option only shows when the user has permissions to delete the displaying item
@nielsvanvelzen nielsvanvelzen marked this pull request as ready for review January 24, 2023 20:41
@nielsvanvelzen nielsvanvelzen enabled auto-merge (rebase) January 26, 2023 18:54
@nielsvanvelzen nielsvanvelzen merged commit d69a063 into jellyfin:master Jan 27, 2023
@nielsvanvelzen nielsvanvelzen deleted the media-management branch January 27, 2023 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants