-
Notifications
You must be signed in to change notification settings - Fork 867
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
Undo Feature For Remove From Playlist. #5885
base: development
Are you sure you want to change the base?
Conversation
Could you please also undo the changes to the unrelated files? This time please do it in this pull request instead of closing and creating a duplicate one. |
@@ -129,11 +129,10 @@ function moveVideoDown(videoId, playlistItemId) { | |||
} | |||
|
|||
/** | |||
* @param {string} videoId | |||
* @param {string} playlistItemId | |||
* @param {string} result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {string} result | |
* @param {any} video |
function removeFromPlaylist(result) { | ||
emit('remove-from-playlist', result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function removeFromPlaylist(result) { | |
emit('remove-from-playlist', result) | |
function removeFromPlaylist(video) { | |
emit('remove-from-playlist', video) |
Head branch was pushed to by a user without write access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a file telling editor to use spaces instead of tabs for indent
https://github.com/FreeTubeApp/FreeTube/blob/development/.editorconfig
Please setup your editor (info at https://editorconfig.org) and fix those tabs
this.removeVideo({ | ||
_id: this.playlistId, | ||
videoId: videoData.videoId, | ||
playlistItemId: videoData.playlistItemId, | ||
}) | ||
|
||
// Update playlist's `lastUpdatedAt` | ||
this.updatePlaylist({ _id: this.playlistId }) | ||
showToast(this.$t('User Playlists.SinglePlaylistView.Toast["Video has been removed. Click here to undo."]'), 3000, () => { | ||
this.addVideoBackToPlaylist(videoData); | ||
} | ||
); | ||
} catch (e) { | ||
showToast(this.$t('User Playlists.SinglePlaylistView.Toast.There was a problem with removing this video')) | ||
console.error(e) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these
Also remove the last blank line before the end of method?
showToast(this.$t('User Playlists.SinglePlaylistView.Toast.There was a problem with removing this video')) | ||
console.error(e) | ||
showToast(this.$t('User Playlists.SinglePlaylistView.Toast.There was a problem with adding this video back to playlist')); | ||
console.error(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unnecessary semicolons
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In src/renderer/views/Playlist/Playlist.vue
there is another usage of removeVideoFromPlaylist
that should be updated
Head branch was pushed to by a user without write access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo should place the video in the same position it was in before. Now it behaves like you have deleted the video and manually added it again to the playlist.
VirtualBoxVM_W0FVtMIPuA.mp4
2024-11-24.13-55-47.1.1.mp4can you please recheck? It works fine for every sort type, It happens only for custom filter where anyways videos can be rearranged. |
@Soham456 "Custom" is how the videos are actually stored in the playlist, that is the real order of the videos. So the problem happens regardless of the sort order, it is just that the other ones hide it from you. An "undo" feature should undo the change properly, as if the change had never even occurred, so an "undo" button that doesn't place the video back in its original place in the playlist is only doing half of its job. |
Pull Request Type
Related issue
closes #5421
Additional context
resolved yarn.lock conflict