mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +02:00
Save and offer resume only for local files
We do not know if the online URI still leads to the same file as before (or if different one leads to previous). Additionally we would also need to check if media is seekable. Disable for now to avoid problems.
This commit is contained in:
@@ -308,21 +308,21 @@ class ClapperPlayer extends PlayerBase
|
||||
}
|
||||
/* If "quitOnStop" is set here it means that we are in middle of autoclosing */
|
||||
if(this.state !== GstClapper.ClapperState.STOPPED && !this.quitOnStop) {
|
||||
const playlistItem = this.playlistWidget.getActiveRow();
|
||||
|
||||
let resumeInfo = {};
|
||||
if(settings.get_boolean('resume-enabled')) {
|
||||
const resumeTitle = this.playlistWidget.getActiveFilename();
|
||||
if(playlistItem.isLocalFile && settings.get_boolean('resume-enabled')) {
|
||||
const resumeTime = Math.floor(this.position / 1000000000);
|
||||
const resumeDuration = this.duration / 1000000000;
|
||||
|
||||
/* Do not save resume info when title is too long (random URI),
|
||||
* video is very short, just started or almost finished */
|
||||
/* Do not save resume info when video is very short,
|
||||
* just started or almost finished */
|
||||
if(
|
||||
resumeTitle.length < 300
|
||||
&& resumeDuration > 60
|
||||
resumeDuration > 60
|
||||
&& resumeTime > 15
|
||||
&& resumeDuration - resumeTime > 20
|
||||
) {
|
||||
resumeInfo.title = resumeTitle;
|
||||
resumeInfo.title = playlistItem.filename;
|
||||
resumeInfo.time = resumeTime;
|
||||
resumeInfo.duration = resumeDuration;
|
||||
|
||||
|
Reference in New Issue
Block a user