@@ -665,64 +665,56 @@ const dlQueue = async.queue((task, done) => {
665
665
* Watch a Replay - Use either internal player or external depending on settings
666
666
*/
667
667
ipcMain . on ( 'watch-replay' , ( event , arg ) => {
668
- DataManager . addWatched ( arg . videoid )
668
+ let playerpath = appSettings . get ( 'general.playerpath' ) || ' '
669
669
670
- LiveMe . getVideoInfo ( arg . videoid )
671
- . then ( video => {
672
- let playerpath = appSettings . get ( 'general.playerpath' ) || ' '
673
-
674
- if ( playerpath . length > 5 ) {
675
- exec ( playerpath . replace ( '%url%' , LiveMe . pickProperVideoSource ( video ) ) )
676
- } else {
677
- // Open internal player
678
- if ( playerWindow == null ) {
679
- let winposition = appSettings . get ( 'position.playerWindow' ) ? appSettings . get ( 'position.playerWindow' ) : [ - 1 , - 1 ]
680
- let winsize = appSettings . get ( 'size.playerWindow' ) ? appSettings . get ( 'size.playerWindow' ) : [ 360 , 640 ]
681
-
682
- playerWindow = new BrowserWindow ( {
683
- icon : path . join ( __dirname , 'appicon.png' ) ,
684
- width : winsize [ 0 ] ,
685
- height : winsize [ 1 ] ,
686
- x : winposition [ 0 ] !== - 1 ? winposition [ 0 ] : null ,
687
- y : winposition [ 1 ] !== - 1 ? winposition [ 1 ] : null ,
688
- minWidth : 360 ,
689
- minHeight : 360 ,
690
- darkTheme : true ,
691
- autoHideMenuBar : false ,
692
- disableAutoHideCursor : true ,
693
- titleBarStyle : 'default' ,
694
- maximizable : false ,
695
- frame : false ,
696
- backgroundColor : '#000000' ,
697
- webPreferences : {
698
- webSecurity : false ,
699
- textAreasAreResizable : false ,
700
- plugins : true
701
- }
702
- } )
703
- playerWindow . setMenu ( Menu . buildFromTemplate ( getMiniMenuTemplate ( ) ) )
704
- playerWindow . on ( 'close' , ( ) => {
705
- appSettings . set ( 'position.playerWindow' , playerWindow . getPosition ( ) )
706
- appSettings . set ( 'size.playerWindow' , playerWindow . getSize ( ) )
707
-
708
- playerWindow . webContents . session . clearCache ( ( ) => {
709
- // Purge the cache to help avoid eating up space on the drive
710
- } )
711
- playerWindow = null
712
- } )
713
- playerWindow . loadURL ( `file://${ __dirname } /app/player.html` )
714
- playerWindow . webContents . once ( 'dom-ready' , ( ) => {
715
- playerWindow . webContents . send ( 'play-video' , video , appSettings . get ( 'player' ) )
716
- } )
717
- } else {
718
- playerWindow . webContents . send ( 'play-video' , video , appSettings . get ( 'player' ) )
670
+ if ( playerpath . length > 5 ) {
671
+ exec ( playerpath . replace ( '%url%' , arg . source ) )
672
+ } else {
673
+ // Open internal player
674
+ if ( playerWindow == null ) {
675
+ let winposition = appSettings . get ( 'position.playerWindow' ) ? appSettings . get ( 'position.playerWindow' ) : [ - 1 , - 1 ]
676
+ let winsize = appSettings . get ( 'size.playerWindow' ) ? appSettings . get ( 'size.playerWindow' ) : [ 360 , 640 ]
677
+
678
+ playerWindow = new BrowserWindow ( {
679
+ icon : path . join ( __dirname , 'appicon.png' ) ,
680
+ width : winsize [ 0 ] ,
681
+ height : winsize [ 1 ] ,
682
+ x : winposition [ 0 ] !== - 1 ? winposition [ 0 ] : null ,
683
+ y : winposition [ 1 ] !== - 1 ? winposition [ 1 ] : null ,
684
+ minWidth : 360 ,
685
+ minHeight : 360 ,
686
+ darkTheme : true ,
687
+ autoHideMenuBar : false ,
688
+ disableAutoHideCursor : true ,
689
+ titleBarStyle : 'default' ,
690
+ maximizable : false ,
691
+ frame : false ,
692
+ backgroundColor : '#000000' ,
693
+ webPreferences : {
694
+ webSecurity : false ,
695
+ textAreasAreResizable : false ,
696
+ plugins : true
719
697
}
720
- playerWindow . focus ( )
721
- }
722
- } )
723
- . catch ( err => {
724
- console . log ( '[watch-replay] getVideoInfo Error:' , err )
725
- } )
698
+ } )
699
+ playerWindow . setMenu ( Menu . buildFromTemplate ( getMiniMenuTemplate ( ) ) )
700
+ playerWindow . on ( 'close' , ( ) => {
701
+ appSettings . set ( 'position.playerWindow' , playerWindow . getPosition ( ) )
702
+ appSettings . set ( 'size.playerWindow' , playerWindow . getSize ( ) )
703
+
704
+ playerWindow . webContents . session . clearCache ( ( ) => {
705
+ // Purge the cache to help avoid eating up space on the drive
706
+ } )
707
+ playerWindow = null
708
+ } )
709
+ playerWindow . loadURL ( `file://${ __dirname } /app/player.html` )
710
+ playerWindow . webContents . once ( 'dom-ready' , ( ) => {
711
+ playerWindow . webContents . send ( 'play-video' , arg . source , appSettings . get ( 'player' ) )
712
+ } )
713
+ } else {
714
+ playerWindow . webContents . send ( 'play-video' , arg . source , appSettings . get ( 'player' ) )
715
+ }
716
+ playerWindow . focus ( )
717
+ }
726
718
} )
727
719
728
720
ipcMain . on ( 'save-player-options' , ( event , options ) => {
0 commit comments