-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Internal music player does not stop playing when file is deleted #1292
Conversation
Hmm there are two scenarios which might be problematic here.
|
Ok, second scenario is invalid because external apps cannot use owncloud MediaService but the first one stays valid. |
@przybylski Hi, I have fixed the 1st issue with this commit. |
} | ||
} | ||
catch (NullPointerException e) { | ||
e.printStackTrace(); |
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.
I think instead of printing stack you should write to log @davivel @tobiasKaminsky any thoughts?
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.
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.
I second that, should definitely be a log.Call 👍
@przybylski @AndyScherzinger I have added log statement in latest commit. |
} | ||
} | ||
catch (NullPointerException e) { | ||
Log_OC.e(TAG, "NullPointerException playing " + remotePath, 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.
Isn't it more of as "NullPointerException while stopping" ?
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.
Yup, you are right. I will change that 👍
Why do you need Remote path anyway? It can be get from OCFile. Beside if someone wouldn't provide OCFile as a parcelable it is highly likely that remote path also won't be included. IMO this additional argument is redundant. |
I think if OCFile will be null then OCFile.getRemotePath() will again throw NullPointerException. That's why I included it. |
Yeah, null OCFile won't even be included because in onConfirmation you are doing the check for null, It is a good practice that you are catching null ptr exception, but if REMOTE_PATH is just there for logging purposes then I don't find it very useful. |
Will log statement - Log_OC.e(TAG, "NullPointerException while stopping file "); will be fine ? |
NullPointerException while stopping on OCFile is more descriptive :) |
Okay, I will fix that :) |
Great! :) but now REMOTE_PATH is completely redundant :) |
Sorry, forgot about that. Removing it. |
Code looks good to me. |
@tobiasKaminsky IMO this is ready for merge, I belive it should first go to beta right ? |
@rishabh7m Thank you for your contribution and the will to cooperate with annoying reviewers :) |
@rishabh7m One more thing, could you maybe provide some meaningful commit message :) |
Hi @rishabh7m thanks for contributing and great to have you here. One question since you don't have a "collaborator" tag on your postings. Did you already sign the contributor agreement https://owncloud.org/contribute/agreement/ and send it to @karlitschek and @masensio ? Is this a necessary in order to get your pull requests merged to the code base by the core dev team. |
Hi @AndyScherzinger , I have not signed the agreement earlier. There is an employer field in the agreement but I am a student, so will it be fine to leave that empty? |
@przybylski lol, no one was annoying :) |
@rishabh7m yeah, just leave it empty then, should be fine 👍 |
5562783
to
033e297
Compare
Intent i = new Intent(getActivity(), MediaService.class); | ||
i.putExtra(MediaService.EXTRA_FILE, ocFile); | ||
i.setAction(MediaService.ACTION_STOP_FILE); | ||
getActivity().startService(i); |
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.
It would be great if you set this behaviour also for a local remove, since it makes sense that if you want to remove the file locally, you don't want to keep it in the buffer of the media service.
P.D: The local remove listener is currently set in the negative button (which listener mehotd is onCancel). Extract to a new method to reuse the MediaService call.
Hi, @rishabh7m. Sorry for joining so late, and thanks for your patience. This PR seems really fine, thank you very much. I think @malkomich is right, makes sense stopping the reproduction also when the deletion is only local (method I will help you then with the rebase on master. |
Hi everybody, |
Bug fix for issue #906
edited by @jabarros