Skip to content

Instantly share code, notes, and snippets.

@azhurb
Created August 29, 2017 10:36
Show Gist options
  • Save azhurb/6de1263f1a953752dac40f31f0a71e9f to your computer and use it in GitHub Desktop.
Save azhurb/6de1263f1a953752dac40f31f0a71e9f to your computer and use it in GitHub Desktop.
Fix not ended movies
Index: c/vclub.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- c/vclub.js (revision 271c5b6577b3d5eca58b6133611e04b6960d90e0)
+++ c/vclub.js (revision 8cceabfec92b7fa1c503cb6cfb4636cf4cd373a1)
@@ -828,6 +828,19 @@
this.load_data.bind(key.REFRESH, this);
};
+ this.fill_list = function (data) {
+ _debug('vclub.fill_list', data);
+
+ this.superclass.fill_list.apply(this, [data]);
+
+ _debug('this.history.length', this.history.length);
+ _debug('this.history', this.history);
+
+ if (data.length === 0 && this.history.length == 1){
+ this.enable_color_buttons();
+ }
+ };
+
this.action = function() {
_debug('vclub.action');
Index: c/player.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- c/player.js (revision 5e142d5b27dc2f9194727d69df5d8cbcd85aaa1a)
+++ c/player.js (revision 8cceabfec92b7fa1c503cb6cfb4636cf4cd373a1)
@@ -2750,6 +2750,33 @@
stb.advert.stop_ticking();
+ _debug('stb.cur_place', stb.cur_place);
+ _debug('this.play_auto_ended', this.play_auto_ended);
+ _debug('this.cur_media_item', this.cur_media_item);
+ _debug('this.cur_media_item.media_type', this.cur_media_item.media_type);
+
+ if (stb.cur_place == 'vclub' && !this.play_auto_ended){
+
+ var cur_series = this.cur_media_item.cur_series || 0;
+ var end_time = stb.GetPosTime();
+
+ if (this.cur_media_item.media_type == 'vclub_ad'){
+ module && module.vclub && module.vclub.set_ad_ended_time && module.vclub.set_ad_ended_time(this.cur_media_item.ad_id, end_time, stb.GetMediaLen());
+ }else if (this.cur_media_item.media_type != 'advert'){
+ this.cur_media_item.video_id = this.cur_media_item.video_id || this.cur_media_item.id;
+ this.cur_media_item.video_id && module && module.vclub && module.vclub.set_not_ended && module.vclub.set_not_ended(this.cur_media_item.video_id, cur_series, end_time, this.cur_media_item.id);
+ }
+ }
+
+ if (stb.cur_place == 'vclub' && this.play_auto_ended){
+ this.cur_media_item.video_id = this.cur_media_item.video_id || this.cur_media_item.id;
+ if (this.cur_media_item.media_type == 'vclub_ad'){
+ module && module.vclub && module.vclub.set_ad_ended_time && module.vclub.set_ad_ended_time(this.cur_media_item.ad_id, end_time, stb.GetMediaLen());
+ }else if (this.cur_media_item.media_type != 'advert'){
+ this.cur_media_item.video_id && module && module.vclub && module.vclub.set_ended && module.vclub.set_ended(this.cur_media_item.video_id);
+ }
+ }
+
if (this.cur_media_item.stop_callback){
this.cur_media_item.stop_callback();
return;
@@ -2818,27 +2845,6 @@
this.cancel_quick_ch_switch();
}
- if (stb.cur_place == 'vclub' && !this.play_auto_ended){
-
- var cur_series = this.cur_media_item.cur_series || 0;
- var end_time = stb.GetPosTime();
-
- if (this.cur_media_item.media_type == 'vclub_ad'){
- module && module.vclub && module.vclub.set_ad_ended_time && module.vclub.set_ad_ended_time(this.cur_media_item.ad_id, end_time, stb.GetMediaLen());
- }else if (this.cur_media_item.media_type != 'advert'){
- this.cur_media_item.video_id && module && module.vclub && module.vclub.set_not_ended && module.vclub.set_not_ended(this.cur_media_item.video_id, cur_series, end_time, this.cur_media_item.id);
- }
- }
-
- if (stb.cur_place == 'vclub' && this.play_auto_ended){
-
- if (this.cur_media_item.media_type == 'vclub_ad'){
- module && module.vclub && module.vclub.set_ad_ended_time && module.vclub.set_ad_ended_time(this.cur_media_item.ad_id, end_time, stb.GetMediaLen());
- }else if (this.cur_media_item.media_type != 'advert'){
- this.cur_media_item.video_id && module && module.vclub && module.vclub.set_ended && module.vclub.set_ended(this.cur_media_item.video_id);
- }
- }
-
try{
stb.Stop();
_debug('stb.Stop()');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment