Skip to content

Conversation

@madmini
Copy link
Contributor

@madmini madmini commented May 15, 2025

Fixes #801. Greys out the cut button if the duration is 0:00 and on tap shows snackbar "Cutting live videos is not supported".

Another possible approach could be to try to parse the duration as timestamp, and if it does not parse or is 0, disable cutting.

Note that I am not familiar with other reasons for invalid durations such as -1.

on tap show snackbar "cutting live videos is unsupported"
@madmini
Copy link
Contributor Author

madmini commented May 15, 2025

hmm job failed, seems there is no signing config, which makes sense for a PR run. But the failed CI did initially scare me 😅

Maybe consider disabling the job entirely for PRs

@deniscerri
Copy link
Owner

@madmini just because a result has 0 duration doesnt mean its live stream. It could also be a broken extractor. I think it would be better if you wrote it in the likes of
Cutting is not available for this item

@deniscerri
Copy link
Owner

deniscerri commented May 15, 2025

Also since you added the timestamp check in uiutil you dont have to do it in audio and video fragment
just throw the snack in uiutil and be done with it. keep the cut button disabled in uiutil ofc

@madmini
Copy link
Contributor Author

madmini commented May 15, 2025

okay, but what about the else if(!nonSpecific), which shows a snack with "You need to update the item data in order to be able to use cut feature" and an update button. and during testing this was always the case (and obviously, updating did not change the duration) so i built in the additional check. I had assumed that if there was another error, the duration would be empty or -1.

Is there a proper way to differentiate between an invalid duration and incomplete data?

@deniscerri
Copy link
Owner

ah yeah, i forgot about items with no current data. Alright then lets keep it as it is, its looks good. Just change the snack text. Thanks buddy

@madmini
Copy link
Contributor Author

madmini commented May 15, 2025

I'd also change the name of the "You need to update the item data in order to be able to use cut feature" from cut_unavailable to cut_unavailable_please_update or similar, if thats okay. Seems easy to confuse with cut_unsupported otherwise.

@deniscerri
Copy link
Owner

yeah thats fine

@madmini
Copy link
Contributor Author

madmini commented May 15, 2025

feel free to squash ^^

@deniscerri deniscerri merged commit 58a7ec5 into deniscerri:main May 17, 2025
1 check failed
@madmini madmini deleted the fix/disable-cut-for-live-videos branch May 17, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Crash] App crash on cut button click

2 participants