Hello community, here is the log from the commit of package kawaii-player for openSUSE:Factory checked in at 2019-07-16 08:40:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kawaii-player (Old) and /work/SRC/openSUSE:Factory/.kawaii-player.new.1887 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kawaii-player" Tue Jul 16 08:40:41 2019 rev:6 rq:714983 version:4.2.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/kawaii-player/kawaii-player.changes 2019-06-19 21:10:27.666629454 +0200 +++ /work/SRC/openSUSE:Factory/.kawaii-player.new.1887/kawaii-player.changes 2019-07-16 08:40:54.083027754 +0200 @@ -1,0 +2,33 @@ +Sat Jul 13 07:32:46 UTC 2019 - Luigi Baldoni <[email protected]> + +- Update to version 4.2.0-1 + New Features: + * When using libmpv, it is possible to show transparent + widgets (ie playlist, titlelist, control frame etc..) + directly on video. This property is available in + Preferences->Appearance->Widgets on video. + * In dark theme, users can manually change color of background + and control frame. Few combinations are available by default + Preferences->Appearance->Try. Users can choose any color, + but most likely only dark shade of any color may look good + on this theme (along with bold fonts). + * Added Playlist Continue option in Preferences->Player + Bug fixes and modifications: + * fixed: cache pause seconds option when using libmpv + * fixed: irregular global font size by fixing stylesheet + * It is possible to pass http headers as dictionary to ccurl + function + * No need to restart the application whenever changing mpv + config options from Preferences, when using libmpv. + (However, changing some options like vo/ao may need + restart) + Feature removal: + * Setting external player from Preferences has been removed. + Option is still available, but user will need to manually + edit the config files. + * Music mode deprecated. As one can use detached video mode as + music mode, the music mode somewhat became irrelevant. + Moreover it became buggy and difficult to maintain over the + time. + +------------------------------------------------------------------- Old: ---- kawaii-player-4.1.0-1.tar.gz New: ---- kawaii-player-4.2.0-1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kawaii-player.spec ++++++ --- /var/tmp/diff_new_pack.81uB88/_old 2019-07-16 08:40:54.627027936 +0200 +++ /var/tmp/diff_new_pack.81uB88/_new 2019-07-16 08:40:54.631027937 +0200 @@ -18,10 +18,10 @@ # See also http://en.opensuse.org/openSUSE:Specfile_guidelines -%define _over 4.1.0-1 -%define _bver 4.1.0 +%define _over 4.2.0-1 +%define _bver 4.2.0 Name: kawaii-player -Version: 4.1.0.1 +Version: 4.2.0.1 Release: 0 Summary: Multimedia player, library manager and media server License: GPL-3.0-or-later ++++++ kawaii-player-4.1.0-1.tar.gz -> kawaii-player-4.2.0-1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/get_functions.py new/kawaii-player-4.2.0-1/kawaii_player/get_functions.py --- old/kawaii-player-4.1.0-1/kawaii_player/get_functions.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/get_functions.py 2019-07-12 21:09:25.000000000 +0200 @@ -426,7 +426,8 @@ def ccurl(url, external_cookie=None, user_auth=None, verify_peer=None, - curl_opt=None, out_file=None, referer=None, post_data=None): + curl_opt=None, out_file=None, referer=None, post_data=None, + hdr_data=None): hdr = USER_AGENT if 'youtube.com' in url: hdr = 'Mozilla/5.0 (Linux; Android 4.4.4; SM-G928X Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36' @@ -445,6 +446,10 @@ nUrl = url postfield = '' legacy = True + if hdr_data and isinstance(hdr_data, dict) and len(hdr_data) > 0: + c.setopt(c.HTTPHEADER, [k+': '+v for k,v in hdr_data.items()]) + else: + c.setopt(c.USERAGENT, hdr) if '#' in url and legacy: curl_opt = nUrl.split('#')[1] url = nUrl.split('#')[0] @@ -514,11 +519,9 @@ else: pass if verify_peer is False: - print(verify_peer,'--verify-peer-') c.setopt(c.SSL_VERIFYPEER, False) if curl_opt == '-o': c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) if cookie_file: c.setopt(c.COOKIEFILE, cookie_file) try: @@ -543,19 +546,16 @@ else: if curl_opt == '-I': c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) c.setopt(c.NOBODY, 1) c.setopt(c.HEADERFUNCTION, storage.write) elif curl_opt == '-Ie': c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) c.setopt(pycurl.REFERER, rfr) c.setopt(c.NOBODY, 1) c.setopt(c.HEADERFUNCTION, storage.write) elif curl_opt == '-e': c.setopt(c.FOLLOWLOCATION, True) c.setopt(pycurl.REFERER, rfr) - c.setopt(c.USERAGENT, hdr) c.setopt(c.WRITEDATA, storage) elif curl_opt == '-IA': c.setopt(c.FOLLOWLOCATION, True) @@ -563,7 +563,6 @@ c.setopt(c.HEADERFUNCTION, storage.write) elif curl_opt == '-Icb': c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) c.setopt(c.NOBODY, 1) c.setopt(c.HEADERFUNCTION, storage.write) if os.path.exists(cookie_file): @@ -572,7 +571,6 @@ c.setopt(c.COOKIEFILE, cookie_file) elif curl_opt == '-Ib': c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) c.setopt(c.NOBODY, 1) c.setopt(c.HEADERFUNCTION, storage.write) if os.path.exists(cookie_file): @@ -580,39 +578,35 @@ c.setopt(c.COOKIEFILE, cookie_file) elif curl_opt == '-bc': c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) c.setopt(c.WRITEDATA, storage) c.setopt(c.COOKIEJAR, cookie_file) c.setopt(c.COOKIEFILE, cookie_file) elif curl_opt == '-L': - c.setopt(c.USERAGENT, hdr) c.setopt(c.WRITEDATA, storage) elif curl_opt == '-H': - c.setopt(c.USERAGENT, hdr) - c.setopt(c.NOBODY, 1) - c.setopt(c.HEADERFUNCTION, storage.write) + if hdr_data and isinstance(hdr_data, dict) and len(hdr_data) > 0: + #c.setopt(c.HEADER, True) + c.setopt(c.WRITEDATA, storage) + else: + c.setopt(c.NOBODY, 1) + c.setopt(c.HEADERFUNCTION, storage.write) elif curl_opt == '-d': - c.setopt(c.USERAGENT, hdr) c.setopt(c.WRITEDATA, storage) c.setopt(c.POSTFIELDS, postfield) elif curl_opt == '-postfile': - c.setopt(c.USERAGENT, hdr) c.setopt(c.POST, 1) c.setopt(c.HTTPPOST, [("parameters",(c.FORM_FILE, post_data))]) c.setopt(c.WRITEDATA, storage) elif curl_opt == '-b': c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) c.setopt(c.WRITEDATA, storage) c.setopt(c.COOKIEFILE, cookie_file) elif curl_opt == '-c': c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) c.setopt(c.WRITEDATA, storage) c.setopt(c.COOKIEJAR, cookie_file) else: c.setopt(c.FOLLOWLOCATION, True) - c.setopt(c.USERAGENT, hdr) c.setopt(c.WRITEDATA, storage) try: if user_auth is not None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/kawaii_player.py new/kawaii-player-4.2.0-1/kawaii_player/kawaii_player.py --- old/kawaii-player-4.1.0-1/kawaii_player/kawaii_player.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/kawaii_player.py 2019-07-12 21:09:25.000000000 +0200 @@ -1409,7 +1409,7 @@ self.mplayer_timer = QtCore.QTimer() self.mplayer_timer.timeout.connect(self.mplayer_unpause) self.mplayer_timer.setSingleShot(True) - self.version_number = (4, 1, 0, 0) + self.version_number = (4, 2, 0, 1) self.threadPool = [] self.threadPoolthumb = [] self.thumbnail_cnt = 0 @@ -1471,6 +1471,11 @@ self.torrent_handle = '' self.list_with_thumbnail = True self.mpvplayer_val = QProcessExtra(ui=self) + self.playlist_continue = True + self.bg_color_dark_theme = (56, 60, 74) + self.bg_color_widget_dark_theme = (0, 0, 0) + self.bg_color_control_frame = (0, 0, 0) + self.widgets_on_video = True self.stop_from_client = False self.allowed_access_tokens = [] self.master_access_tokens = set() @@ -1547,7 +1552,7 @@ except Exception as err: logger.error(err) self.global_font = 'Ubuntu' - self.global_font_size = 12 + self.global_font_size = 14 self.show_search_thumbnail = False self.tab_6_size_indicator = [] self.tab_6_player = False @@ -1870,7 +1875,47 @@ self.observer_thread = Observe(self, logger) self.obs = None - + + def decide_widgets_on_video(self, over_video=None, widgets="all"): + if self.widgets_on_video: + if self.player_val == "libmpv" and over_video is False: + if widgets == "all": + self.verticalLayout_50.insertWidget(0, self.list2, 0) + self.verticalLayout_50.insertWidget(5, self.frame_extra_toolbar, 0) + + self.verticalLayout_50.insertWidget(1, self.list6, 0) + self.verticalLayout_50.insertWidget(2, self.list5, 0) + self.verticalLayout_50.insertWidget(3, self.goto_epn, 0) + + self.verticalLayout_40.insertWidget(0, self.list1, 0) + self.verticalLayout_40.insertWidget(1, self.list4, 0) + self.verticalLayout_40.insertWidget(2, self.frame, 0) + elif widgets == "playlist": + self.verticalLayout_50.insertWidget(0, self.list2, 0) + elif widgets == "extra_toolbar": + self.verticalLayout_50.insertWidget(5, self.frame_extra_toolbar, 0) + elif widgets == "queuelist": + self.verticalLayout_50.insertWidget(1, self.list6, 0) + elif widgets == "epn_search": + self.verticalLayout_50.insertWidget(2, self.list5, 0) + elif widgets == "titlelist": + self.verticalLayout_40.insertWidget(0, self.list1, 0) + elif widgets == "title_search": + self.verticalLayout_40.insertWidget(1, self.list4, 0) + elif self.player_val == "libmpv" and self.tab_5.mpv.get_property("idle-active") is False and self.fullscreen_video: + self.gridLayoutVideoPls.addWidget(self.list2, 0, 1, 1, 1) + self.gridLayoutVideoPls.addWidget(self.list6, 1, 1, 1, 1) + self.gridLayoutVideoPls.addWidget(self.list5, 2, 1, 1, 1) + self.gridLayoutVideoPls.addWidget(self.goto_epn, 3, 1, 1, 1) + + self.gridLayoutVideoPls.addWidget(self.frame_extra_toolbar, 4, 1, 1, 1) + + self.gridLayoutVideoPls.addWidget(self.list1, 0, 0, 1, 1) + self.gridLayoutVideoPls.addWidget(self.list4, 1, 0, 1, 1) + self.gridLayoutVideoPls.addWidget(self.frame, 3, 0, 1, 1) + else: + pass + def retranslateUi(self, MainWindow): global home MainWindow.setWindowTitle("Kawaii-Player") @@ -2015,7 +2060,7 @@ else: self.mpvPrevEpnList(*args) - def set_mainwindow_palette(self, fanart, first_time=None, theme=None): + def set_mainwindow_palette(self, fanart, first_time=None, theme=None, rgb_tuple=None): if theme is None or theme == 'default': logger.info('\n{0}: mainwindow background\n'.format(fanart)) if fanart.endswith('default.jpg'): @@ -2035,9 +2080,13 @@ MainWindow.setPalette(palette) self.current_background = fanart elif theme in ['system', 'transparent', 'mix', 'dark']: - if theme == 'dark' and first_time: + if theme == 'dark' and (first_time or rgb_tuple): palette = QtGui.QPalette() - palette.setColor(MainWindow.backgroundRole(), QtGui.QColor(56,60,74)) + if rgb_tuple: + r, g, b = rgb_tuple + else: + r, g, b = self.bg_color_dark_theme + palette.setColor(MainWindow.backgroundRole(), QtGui.QColor(r, g, b)) MainWindow.setPalette(palette) if os.path.isfile(fanart) and self.layout_mode != 'Music': self.current_background = fanart @@ -2057,9 +2106,10 @@ def player_volume_manager(self): if self.frame_extra_toolbar.isHidden(): + self.decide_widgets_on_video() if not self.torrent_frame.isHidden(): self.torrent_frame.hide() - if self.fullscreen_video: + if self.fullscreen_video and not self.widgets_on_video: self.gridLayout.setSpacing(5) self.superGridLayout.setSpacing(5) if platform.system().lower() == "darwin": @@ -2075,6 +2125,7 @@ self.list2.setCurrentRow(self.cur_row) self.title_list_changed = False else: + self.decide_widgets_on_video(over_video=False, widgets="extra_toolbar") if self.fullscreen_video: self.gridLayout.setSpacing(0) self.superGridLayout.setSpacing(0) @@ -3071,9 +3122,11 @@ def queue_manage_list(self): if self.list6.isHidden(): + self.decide_widgets_on_video() self.list6.show() self.list6.setFocus() else: + self.decide_widgets_on_video(over_video=False, widgets="queuelist") self.list6.hide() def goto_epn_filter_on(self): @@ -3447,6 +3500,9 @@ global show_hide_titlelist global sub_id, audio_id change_spacing = False + if self.widgets_on_video: + self.decide_widgets_on_video(over_video=False) + self.superGridLayout.addWidget(self.frame1, 1, 1, 1, 1) if self.player_val == "libmpv": self.epn_clicked = False if self.tab_5.stop_msg and self.tab_5.stop_msg == "openglwidget": @@ -3832,6 +3888,7 @@ show_hide_player = 1 elif val == "Show/Hide Playlist": if not self.list2.isHidden(): + self.decide_widgets_on_video(over_video=False, widgets="playlist") if self.fullscreen_video: self.gridLayout.setSpacing(0) self.superGridLayout.setSpacing(0) @@ -3840,7 +3897,8 @@ ht = self.list2.height() self.list2.hide() self.goto_epn.hide() - show_hide_playlist = 0 + if not self.fullscreen_video: + show_hide_playlist = 0 width = self.label_new.maximumWidth() height = self.label_new.maximumHeight() logger.debug('wd={}::ht={}::{}::{}'.format(width, height, screen_width, screen_height)) @@ -3849,13 +3907,15 @@ self.label_new.setMaximumWidth(self.text.maximumWidth()+self.width_allowed) self.label_new.setMaximumHeight(ht - self.height_allowed - 10) else: - if self.fullscreen_video: + self.decide_widgets_on_video() + if self.fullscreen_video and not self.widgets_on_video: self.gridLayout.setSpacing(5) self.superGridLayout.setSpacing(5) if platform.system().lower() == "darwin": self.tab_5.setMinimumWidth(0) self.list2.show() - show_hide_playlist = 1 + if not self.fullscreen_video: + show_hide_playlist = 1 if MainWindow.isFullScreen(): MainWindow.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) if self.list_with_thumbnail: @@ -3869,10 +3929,12 @@ pass else: if not self.list1.isHidden(): + self.decide_widgets_on_video(over_video=False, widgets="titlelist") ht = self.list1.height() self.list1.hide() self.frame.hide() - show_hide_titlelist = 0 + if not self.fullscreen_video: + show_hide_titlelist = 0 width = self.label_new.maximumWidth() height = self.label_new.maximumHeight() if width != screen_width or height != screen_height: @@ -3880,6 +3942,7 @@ self.label_new.setMaximumWidth(self.text.maximumWidth()+self.width_allowed) self.label_new.setMaximumHeight(ht - self.height_allowed -10) else: + self.decide_widgets_on_video() width = self.label_new.maximumWidth() height = self.label_new.maximumHeight() show_list = True @@ -3887,7 +3950,8 @@ show_list = False if show_list: self.list1.show() - show_hide_titlelist = 1 + if not self.fullscreen_video: + show_hide_titlelist = 1 if MainWindow.isFullScreen(): MainWindow.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) elif val == "Lock File": @@ -6913,6 +6977,7 @@ found_item_index[:]=[] if key: + self.decide_widgets_on_video() self.list4.show() for i in range(self.list1.count()): srch = str(self.list1.item(i).text()) @@ -6925,6 +6990,7 @@ for i in found_item: self.list4.addItem(i) else: + self.decide_widgets_on_video(over_video=False, widgets="title_search") self.list4.clear() self.list4.hide() self.list1.show() @@ -6944,6 +7010,7 @@ if key: #self.list1.hide() + self.decide_widgets_on_video() self.list5.show() for i in range(len(self.epn_arr_list)): srch = self.epn_arr_list[i] @@ -6958,6 +7025,7 @@ for i in found_item: self.list5.addItem(i) else: + self.decide_widgets_on_video(over_video=False, widgets="epn_search") self.list5.clear() self.list5.hide() self.list2.show() @@ -9126,7 +9194,7 @@ self.tab_5.mpv.set_property('playlist-pos', self.cur_row) except Exception as err: logger.error(err) - self.tab_5.mpv.set_property('prefetch-playlist', 'yes') + #self.tab_5.mpv.set_property('prefetch-playlist', 'yes') return True else: return False @@ -9168,7 +9236,7 @@ if self.btnAddon.currentIndex() >= 0: default_arr_setting[4]=self.btnAddon.currentIndex() - def if_path_is_rel(self, path, thumbnail=None, abs_path=False): + def if_path_is_rel(self, path, thumbnail=None, abs_path=False, from_master=False): global my_ipaddress nm = '' if path.startswith('abs_path='): @@ -9235,7 +9303,7 @@ nm = https_val+"://"+str(self.local_ip)+':'+str(self.local_port)+'/' new_torrent_signal.new_signal.emit(old_nm) logger.info('--nm---{0}'.format(nm)) - else: + elif not from_master: nm = self.getdb.epn_return_from_bookmark(nm, from_client=True) return nm @@ -10951,7 +11019,7 @@ if "HTTP error 403 Forbidden" in a: print(a) self.quit_really = "yes" - if self.quit_really == "no" and not self.epn_wait_thread.isRunning(): + if self.playlist_continue and self.quit_really == "no" and not self.epn_wait_thread.isRunning(): if self.tab_5.isHidden() and thumbnail_indicator: length_1 = self.list2.count() q3="self.label_epn_"+str(length_1+self.thumbnail_label_number[0])+".setText(self.epn_name_in_list)" @@ -10990,7 +11058,7 @@ self.getNextInList(eofcode='end') else: self.getQueueInList(eofcode='end') - elif self.quit_really == "yes": + elif (self.quit_really == "yes" or not self.playlist_continue): self.player_stop.clicked_emit() self.list2.setFocus() elif self.player_val.lower() == "mplayer": @@ -13268,13 +13336,29 @@ logger.debug(libmpv_api) self.tab_5 = MpvOpenglWidget(MainWindow, self, logger, TMPDIR, libmpv_api, app) self.tab_5.setObjectName(_fromUtf8("tab_5")) + self.gridLayoutVideo = QtWidgets.QGridLayout(self.tab_5) + self.gridLayoutVideo.setObjectName(_fromUtf8("gridLayoutVideo")) + self.gridLayoutVideo.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignBottom) self.gridLayout.addWidget(self.tab_5, 0, 1, 1, 1) + self.gridLayoutVideoPls = QtWidgets.QGridLayout(self.tab_5) + self.gridLayoutVideo.addLayout(self.gridLayoutVideoPls, 0, 1, 1, 1) + self.gridLayoutVideoPls.setObjectName(_fromUtf8("gridLayoutVideoPls")) + self.gridLayoutVideoPls.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignBottom) + + + self.gridLayout.addWidget(self.tab_5, 0, 1, 1, 1) + + self.tab_5.setMouseTracking(True) self.tab_5.hide() self.tab_5_layout = QtWidgets.QVBoxLayout(self.tab_5) self.tab_5_layout.setContentsMargins(0, 0, 0, 0) self.tab_5_layout.setSpacing(0) + self.gridLayoutVideo.setContentsMargins(0, 0, 0, 0) + self.gridLayoutVideo.setSpacing(5) + self.gridLayoutVideoPls.setContentsMargins(0, 0, 0, 0) + self.gridLayoutVideoPls.setSpacing(5) self.tab_5_layout.setAlignment(QtCore.Qt.AlignCenter|QtCore.Qt.AlignBottom) #self.idw = str(int(self.tab_5.winId())) self.idw = "-1" @@ -14137,7 +14221,8 @@ try: extra_players = j.split(',') for extra_player in extra_players: - if (extra_player not in ui.playback_engine + if (extra_player + and extra_player not in ui.playback_engine and extra_player.lower() != 'none'): ui.playback_engine.append(extra_player) except Exception as e: @@ -14163,6 +14248,22 @@ ui.list_text_color = list_color except Exception as e: logger.error(e) + elif i.startswith('BG_COLOR_DARK_THEME='): + try: + color_tuple_string = j.lower() + color_tuple_string = re.sub('\(|\)', '', color_tuple_string) + r, g, b = color_tuple_string.split(',') + ui.bg_color_dark_theme = (int(r), int(g), int(b)) + except Exception as e: + logger.error(e) + elif i.startswith('BG_COLOR_CONTROL_FRAME='): + try: + color_tuple_string = j.lower() + color_tuple_string = re.sub('\(|\)', '', color_tuple_string) + r, g, b = color_tuple_string.split(',') + ui.bg_color_control_frame = (int(r), int(g), int(b)) + except Exception as e: + logger.error(e) elif i.startswith('LIST_TEXT_COLOR_FOCUS='): try: list_color = j.lower() @@ -14183,8 +14284,8 @@ elif i.startswith('FONT_BOLD='): try: font_bold = j.lower() - if font_bold in ['false', 'no']: - ui.font_bold = False + if font_bold in ['true', 'yes']: + ui.font_bold = True except Exception as e: logger.error(e) elif i.startswith('GLOBAL_FONT_SIZE='): @@ -14207,6 +14308,13 @@ ui.restore_volume = True except Exception as e: logger.error(e) + elif i.startswith('PLAYLIST_CONTINUE='): + try: + plc = j.lower() + if plc in ['false', 'no']: + ui.playlist_continue = False + except Exception as e: + logger.error(e) elif i.startswith('REMEMBER_ASPECT_PER_VIDEO='): try: asp = j.lower() @@ -14220,6 +14328,15 @@ ui.device_pixel_ratio = pxr except Exception as e: logger.error(e) + elif i.startswith('WIDGETS_ON_VIDEO='): + try: + val_bool = j.lower() + if val_bool in ['true', 'yes']: + ui.widgets_on_video = True + else: + ui.widgets_on_video = False + except Exception as e: + logger.error(e) elif i.startswith('AUDIO_OUTPUTS='): try: ui.audio_outputs = j @@ -14316,6 +14433,7 @@ f.write("\nOSX_NATIVE_FULLSCREEN=False") f.write("\nLIBMPV_API=OPENGL-CB") f.write("\nDEVICE_PIXEL_RATIO=1.0") + f.write("\nPLAYLIST_CONTINUE=True") ui.local_ip_stream = '127.0.0.1' ui.local_port_stream = 9001 if ui.player_theme == 'mix': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/mpv_opengl.py new/kawaii-player-4.2.0-1/kawaii_player/mpv_opengl.py --- old/kawaii-player-4.1.0-1/kawaii_player/mpv_opengl.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/mpv_opengl.py 2019-07-12 21:09:25.000000000 +0200 @@ -309,6 +309,9 @@ me.mpv.set_property('loop-file', 'no') except Exception as err: print(err) + +def mpv_log(level, component, msg): + print('[{}] {}: {}'.format(level, component, msg)) class MpvOpenglWidget(QOpenGLWidget): @@ -337,6 +340,7 @@ self.args_dict.update({"ao":"pulse"}) elif os.name == "nt": self.args_dict.update({"ao":"wasapi"}) + self.default_args = self.args_dict.copy() if gui.mpvplayer_string_list and gui.use_custom_config_file: self.create_args_dict() locale.setlocale(locale.LC_NUMERIC, 'C') @@ -425,9 +429,14 @@ self.file_size = 0 self.first_play = True self.stop_msg = None + self.pointer_moved = False def init_opengl_cb(self): - self.mpv = MPV(**self.args_dict) + try: + self.mpv = MPV(log_handler=mpv_log, **self.args_dict) + except Exception as err: + logger.error("\nSome wrong config option. Restoring default\n") + self.mpv = MPV(**self.default_args) self.mpv.observe_property("time-pos", self.time_observer) self.mpv.observe_property("eof-reached", self.eof_observer) self.mpv.observe_property("idle-active", self.idle_observer) @@ -452,12 +461,24 @@ def init_opengl_render(self): self.mpv = mpv.Context() self.mpv.initialize() + self.mpv.set_log_level('no') for key, value in self.args_dict.items(): key = key.replace('_', '-') if isinstance(value, bool): value = 'yes' if value else 'no' - self.mpv.set_option(key, value) - + try: + self.mpv.set_option(key, value) + except Exception as err: + logger.error("Error in setting property: {} => {}, Correct config options.".format(key, value)) + if key == "msg-level": + try: + if "=" in value: + self.mpv.set_log_level(value.rsplit('=', 1)[-1]) + else: + self.mpv.set_log_level(value) + except Exception as err: + logger.error("Error setting log-level") + self.mpv.observe_property('time-pos') self.mpv.observe_property('duration') self.mpv.observe_property('eof-reached') @@ -494,7 +515,9 @@ if event.id in {mpv.Events.none, mpv.Events.shutdown}: break elif event.id == mpv.Events.log_message: - pass + event_log = event.data + log_msg = "[{}] {}-{}".format(event_log.level, event_log.prefix, event_log.text.strip()) + print(log_msg) elif event.id == mpv.Events.property_change: event_prop = event.data observer_function = self.observer_map.get(event_prop.name) @@ -584,7 +607,9 @@ if gui.gapless_playback or gui.gapless_network_stream: self.args_dict.update({'gapless-audio':True}) self.args_dict.update({'prefetch-playlist': True}) - + if isinstance(gui.cache_pause_seconds, int) and gui.cache_pause_seconds > 0: + self.args_dict.update({'cache-pause': True}) + self.args_dict.update({'cache-pause-wait': gui.cache_pause_seconds}) for param in gui.mpvplayer_string_list: if "=" in param: k, v = param.split("=", 1) @@ -594,6 +619,14 @@ if k.startswith('--'): k = k[2:] k = k.replace("-", "_") + if isinstance(v, str) and v.startswith('"'): + v = v[1:] + if v.endswith('"'): + v = v[:-1] + if isinstance(v, str) and v.startswith("'"): + v = v[1:] + if v.endswith("'"): + v = v[:-1] self.args_dict.update({k:v}) self.args_dict.update({"vo":"libmpv"}) @@ -675,7 +708,7 @@ def playback_abort_observer(self, name, value): site = self.ui.get_parameters_value(st='site')['site'] logger.debug('\n..{} {}..\n'.format(name, value)) - if self.ui.epn_clicked and value is True: + if self.ui.epn_clicked and value is True and self.ui.playlist_continue: if self.ui.cur_row < self.ui.list2.count(): self.ui.list2.setCurrentRow(self.ui.cur_row) item = self.ui.list2.item(self.ui.cur_row) @@ -798,7 +831,12 @@ def send_fake_event(self, val): self.fake_mousemove_event = ("libmpv", True) pos = self.cursor().pos() - new_point = QtCore.QPoint(pos.x() + 1, pos.y()+1) + if not self.pointer_moved: + new_point = QtCore.QPoint(pos.x() + 1, pos.y()) + self.pointer_moved = True + else: + new_point = QtCore.QPoint(pos.x() - 1, pos.y()) + self.pointer_moved = False self.cursor().setPos(new_point) if val == "mouse_release": event = QtGui.QMouseEvent( @@ -860,8 +898,9 @@ if item: gui.list2.itemDoubleClicked['QListWidgetItem*'].emit(item) self.playlist_backup = False - if value in [None, True] and self.ui.quit_really: + if (value in [None, True] and (self.ui.quit_really or not self.ui.playlist_continue)): self.mpv.command("stop") + self.ui.player_stop.clicked_emit() def check_queued_item(self): if self.ui.queue_url_list: @@ -955,7 +994,7 @@ and site.lower() not in ["video", "music", "none", "myserver"]): if site.lower() == "playlists": self.ui.stale_playlist = True - if self.mpv.get_property("playlist-count") == 1: + if self.mpv.get_property("playlist-count") == 1 and self.ui.playlist_continue: logger.debug("only single playlist..") self.mpv.set_property('loop-playlist', 'no') self.mpv.set_property('loop-file', 'no') @@ -994,12 +1033,16 @@ self.ui.epn_clicked = False self.started = True z = 'duration is {:.2f}s'.format(value) - gui.progressEpn.setFormat((z)) + #gui.progressEpn.setFormat((z)) gui.mplayerLength = int(value) try: self.file_size = self.mpv.get_property('file-size') except Exception as err: self.file_size = 0 + try: + self.mpv.set_property("ao-volume", str(gui.player_volume)) + except Exception as err: + logger.error(err) gui.progress_counter = 0 gui.slider.setRange(0, int(gui.mplayerLength)) gui.final_playing_url = self.mpv.get_property('path') @@ -1032,7 +1075,7 @@ pass if gui.restore_volume and vol: try: - self.mpv.set_property('ao-volume', vol) + self.mpv.set_property('ao-volume', str(vol)) except Exception as err: logger.error(err) param_dict = gui.get_parameters_value(o='opt', s="site") @@ -1386,9 +1429,12 @@ self.setMouseTracking(True) if platform.system().lower() == "darwin": self.setMinimumWidth(MainWindow.width()) - + if self.ui.widgets_on_video: + self.ui.gridLayoutVideo.addWidget(self.ui.frame1, 2, 1, 1, 1) elif mode == "nofs": #self.hide() + if self.ui.widgets_on_video: + self.ui.superGridLayout.addWidget(self.ui.frame1, 1, 1, 1, 1) if platform.system().lower() == "darwin": self.mpv.command("set", "pause", "yes") self.ui.gridLayout.setSpacing(5) @@ -1438,7 +1484,6 @@ self.setMinimumHeight(0) if not self.mx_timer.isActive() and platform.system().lower() != "darwin": self.mx_timer.start(1000) - else: if self.ui.detach_fullscreen: self.ui.detach_fullscreen = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/player.py new/kawaii-player-4.2.0-1/kawaii_player/player.py --- old/kawaii-player-4.1.0-1/kawaii_player/player.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/player.py 2019-07-12 21:09:25.000000000 +0200 @@ -1,5 +1,7 @@ import os import re +import time +import platform from collections import OrderedDict from PyQt5 import QtCore, QtGui, QtWidgets from player_functions import ccurl, open_files @@ -193,6 +195,18 @@ else: self.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) #self.ui.frame1.show() + if self.ui.fullscreen_video: + fn = lambda val: time.strftime('%H:%M:%S', time.gmtime(int(val))) + status_string = '{} / {} Title: {}'.format(fn(self.ui.progress_counter), + fn(self.ui.mplayerLength), + self.ui.epn_name_in_list[:100]) + if self.ui.player_val == "libmpv": + self.ui.tab_5.mpv.command("show-text", status_string, 1000) + else: + msg = bytes("show-text '{}' 1000".format(status_string), "utf-8") + self.ui.mpvplayer_val.write(msg) + #if self.ui.player_val == "libmpv" and self.ui.fullscreen_video and self.ui.widgets_on_video: + # self.ui.frame1.show() self.arrow_timer.start(1000) if MainWindow.isFullScreen() or self.ui.player_val == "libmpv": ht = self.height() @@ -203,7 +217,7 @@ elif pos.y() <= ht-128 and not self.ui.frame1.isHidden(): param_dict = self.ui.get_parameters_value(st='site') site = param_dict['site'] - if (site != "Music" and self.ui.tab_6.isHidden() and self.ui.player_val != "libmpv" + if (site != "Music" and self.ui.tab_6.isHidden() and self.ui.fullscreen_video and self.ui.list2.isHidden() and self.ui.tab_2.isHidden()): self.ui.frame1.hide() self.ui.gridLayout.setSpacing(5) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/serverlib.py new/kawaii-player-4.2.0-1/kawaii_player/serverlib.py --- old/kawaii-player-4.1.0-1/kawaii_player/serverlib.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/serverlib.py 2019-07-12 21:09:25.000000000 +0200 @@ -878,7 +878,7 @@ logger.info(tmp_bookmark) si_te = tmp_arr[0] op_t = tmp_arr[1] - site_Name = tmp_arr[2] + site_name = tmp_arr[2] if len(tmp_arr) == 7: na_me = tmp_arr[3] if tmp_arr[4] == 'False': @@ -912,25 +912,23 @@ module = imp.import_module(si_te, plugin_path) si_te_var = getattr(module, si_te)(TMPDIR) - if si_te == "SubbedAnime" or si_te == "DubbedAnime": - if si_te == "SubbedAnime": - if si_te_var: - try: - finalUrl = si_te_var.getFinalUrl( - site_Name, na_me, ep_n, mirrorNo, category, - ui.client_quality_val) - except Exception as err: - print(err, '--863--') - return 0 - elif si_te == "DubbedAnime": - if si_te_var: - try: - finalUrl = si_te_var.getFinalUrl( - site_Name, na_me, ep_n, mirrorNo, - ui.client_quality_val) - except Exception as err: - print(err, '--872--') - return 0 + if si_te in ["SubbedAnime", "DubbedAnime"]: + if si_te == "SubbedAnime" and si_te_var: + try: + finalUrl = si_te_var.getFinalUrl( + na_me, ep_n, mirrorNo, + ui.client_quality_val, site_name, category) + except Exception as err: + print(err, '--863--') + return 0 + elif si_te == "DubbedAnime" and si_te_var: + try: + finalUrl = si_te_var.getFinalUrl( + na_me, ep_n, mirrorNo, + ui.client_quality_val, site_name, category) + except Exception as err: + print(err, '--872--') + return 0 else: try: if vi_deo_local_stream: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/settings_widget.py new/kawaii-player-4.2.0-1/kawaii_player/settings_widget.py --- old/kawaii-player-4.1.0-1/kawaii_player/settings_widget.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/settings_widget.py 2019-07-12 21:09:25.000000000 +0200 @@ -410,6 +410,19 @@ self.tabs_present = False self.setMouseTracking(True) self.font_families = ['default'] + self.color_themes_counter = 0 + self.default_color_themes = { + 1: ((56, 60, 74), (0, 0, 0)), + 2: ((85, 85, 0), (40, 23, 18)), + 3: ((59, 28, 41), (15, 12, 34)), + 4: ((83, 41, 0), (19, 16, 42)), + 5: ((91, 88, 73), (42, 41, 29)), + 6: ((90, 90, 67), (44, 0, 33)), + 7: ((117, 80, 130), (23, 29, 58)), + 8: ((125, 125, 93), (58, 29, 0)), + 9: ((47, 159, 176), (19, 16, 42)), + 10: ((127, 101, 60), (44, 0, 33)) + } def mouseMoveEvent(self, event): if ui.auto_hide_dock: @@ -476,7 +489,7 @@ def appeareance_setdefault(self): if ui.player_theme == 'dark': - fonts = ['noto serif', 'noto sans', 'ubuntu'] + fonts = ['ubuntu mono', 'monaco', 'noto serif', 'noto sans', 'ubuntu'] found = None for font in fonts: for family in self.font_families: @@ -489,14 +502,14 @@ ui.global_font = found else: self.global_font = QtGui.QFont().defaultFamily() - ui.global_font_size = 12 + ui.global_font_size = 14 ui.font_bold = False ui.thumbnail_text_color = 'lightgray' ui.thumbnail_text_color_focus = 'green' ui.list_text_color = 'lightgray' ui.list_text_color_focus = 'violet' elif ui.player_theme == 'default': - fonts = ['ubuntu', 'noto sans', 'noto serif'] + fonts = ['ubuntu', 'monaco', 'ubuntu mono', 'noto sans', 'noto serif'] found = None for font in fonts: for family in self.font_families: @@ -846,6 +859,17 @@ self.text113.setText("Device Pixel Ratio") self.param_list.append('device_pixel_ratio') + msg = "<html>Allow transparent widgets on fullscreen video. Only available when using libmpv backend.</html>" + self.line114 = QtWidgets.QComboBox() + self.line114.setToolTip(msg) + self.line114.addItem("True") + self.line114.addItem("False") + index = self.line114.findText(str(ui.widgets_on_video)) + self.line114.setCurrentIndex(index) + self.text114 = QtWidgets.QLabel() + self.text114.setText("Widgets On Video") + self.param_list.append('widgets_on_video') + for i, j in enumerate(self.param_list): index = i+1 if index < 10: @@ -855,14 +879,114 @@ text = eval('self.text1{}'.format(index_str)) line = eval('self.line1{}'.format(index_str)) self.gl1.addWidget(text, index, 0, 1, 1) - self.gl1.addWidget(line, index, 1, 1, 1) + self.gl1.addWidget(line, index, 1, 1, 6) obj_name = text.text().upper().replace(' ', '_') line.setObjectName(obj_name) if isinstance(line, QtWidgets.QComboBox): line.currentIndexChanged['int'].connect(partial(self.combobox_changed, line, j, 'appearance')) elif isinstance(line, QtWidgets.QLineEdit): line.returnPressed.connect(partial(self.line_entered, line, j, 'appearance')) + + self.bg_color_label = QtWidgets.QLabel(self) + self.bg_color_label.setText('BG Color') + self.bg_color_label.setToolTip('<html>Set Background Color. Only works in dark theme.</html>') + self.bg_color_label.setWordWrap(True) + self.gl1.addWidget(self.bg_color_label, index+1, 0, 1, 1) + self.bg_color_value = QPushButtonExtra(self) + self.bg_color_value.setToolTip("<html>click to change background color</html>") + self.bg_color_value.clicked_connect( + partial(self.choose_color, self.bg_color_value, 'bg', 'bg_color_value') + ) + self.gl1.addWidget(self.bg_color_value, index+1, 1, 1, 1) + + self.bg_color_valued = QPushButtonExtra(self) + self.bg_color_valued.setText("D") + self.bg_color_valued.setToolTip("<html>Restore Default Background Color</html>") + self.bg_color_valued.clicked_connect( + partial(self.restore_color, self.bg_color_value, 'bg') + ) + self.gl1.addWidget(self.bg_color_valued, index+1, 2, 1, 1) + + self.bg_color_label_widgetc = QtWidgets.QLabel(self) + self.bg_color_label_widgetc.setText('Control Frame') + self.bg_color_label_widgetc.setToolTip('<html>Set Control Frame Color. Only works in dark theme.</html>') + self.bg_color_label_widgetc.setWordWrap(True) + self.gl1.addWidget(self.bg_color_label_widgetc, index+1, 3, 1, 1) + self.bg_color_value_widgetc = QPushButtonExtra(self) + self.bg_color_value_widgetc.setToolTip("<html>click to change background color of control frame</html>") + self.bg_color_value_widgetc.clicked_connect( + partial(self.choose_color, self.bg_color_value_widgetc, 'bg-widget', 'bg_color_value_widgetc') + ) + self.gl1.addWidget(self.bg_color_value_widgetc, index+1, 4, 1, 1) + + self.bg_color_value_widgetcd = QPushButtonExtra(self) + self.bg_color_value_widgetcd.setText("D") + self.bg_color_value_widgetcd.setToolTip("<html>Restore Default Color of Control Frame</html>") + self.bg_color_value_widgetcd.clicked_connect( + partial(self.restore_color, self.bg_color_value_widgetc, 'frame') + ) + self.gl1.addWidget(self.bg_color_value_widgetcd, index+1, 5, 1, 1) + + self.bg_color_try = QPushButtonExtra(self) + self.bg_color_try.setText("Try") + self.bg_color_try.setToolTip("<html>Click To Try Various color themes</html>") + self.bg_color_try.clicked_connect( + partial(self.try_bg_colors, self.bg_color_try, 'bg-color') + ) + self.gl1.addWidget(self.bg_color_try, index+1, 6, 1, 1) + def try_bg_colors(self, widget, val): + self.color_themes_counter += 1 + if self.color_themes_counter <= len(self.default_color_themes): + rgbw, rgbf = self.default_color_themes.get(self.color_themes_counter) + self.set_colors(self.bg_color_value, "bg_color_value", rgbw) + self.set_colors(self.bg_color_value_widgetc, "bg_color_value_widgetc", rgbf) + else: + self.color_themes_counter = 0 + + def restore_color(self, widget, widget_type): + if widget_type == "frame": + rgb = (0, 0, 0) + widget.setStyleSheet('background:rgb({},{}, {});'.format(0, 0, 0)) + ui.bg_color_control_frame = rgb + ui.widget_style.apply_stylesheet(theme=ui.player_theme) + change_opt_file(self.option_file, "BG_COLOR_CONTROL_FRAME=", "BG_COLOR_CONTROL_FRAME="+str(rgb)) + elif widget_type == "bg": + rgb = (56, 60, 74) + widget.setStyleSheet('background:rgb({},{}, {});'.format(56, 60, 74)) + ui.set_mainwindow_palette(ui.default_background, first_time=False, theme=ui.player_theme, rgb_tuple=rgb) + change_opt_file(self.option_file, "BG_COLOR_DARK_THEME=", "BG_COLOR_DARK_THEME="+str(rgb)) + ui.bg_color_dark_theme = rgb + + def choose_color(self, widget, name, widget_name): + if widget_name == "bg_color_value": + r, g, b = ui.bg_color_dark_theme + elif widget_name == "bg_color_value_widgetc": + r, g, b = ui.bg_color_control_frame + else: + r, g, b = (0,0,0) + color = QtWidgets.QColorDialog.getColor(QtGui.QColor(r, g, b)) + if color.isValid(): + color_name = color.name().upper() + rgb = (color.red(), color.green(), color.blue()) + print(rgb) + self.set_colors(widget, widget_name, rgb) + + def set_colors(self, widget, widget_name, rgb): + widget.setStyleSheet('background:rgb{};'.format(rgb)) + if widget_name == "bg_color_value": + ui.set_mainwindow_palette(ui.default_background, first_time=False, theme=ui.player_theme, rgb_tuple=rgb) + change_opt_file(self.option_file, "BG_COLOR_DARK_THEME=", "BG_COLOR_DARK_THEME="+str(rgb)) + ui.bg_color_dark_theme = rgb + elif widget_name == "bg_color_value_widget": + ui.bg_color_widget_dark_theme = rgb + ui.widget_style.apply_stylesheet(theme=ui.player_theme) + change_opt_file(self.option_file, "BG_COLOR_WIDGET_DARK_THEME=", "BG_COLOR_WIDGET_DARK_THEME="+str(rgb)) + elif widget_name == "bg_color_value_widgetc": + ui.bg_color_control_frame = rgb + ui.widget_style.apply_stylesheet(theme=ui.player_theme) + change_opt_file(self.option_file, "BG_COLOR_CONTROL_FRAME=", "BG_COLOR_CONTROL_FRAME="+str(rgb)) + def mediaserver(self): self.media_param = [] self.line11 = QtWidgets.QLineEdit() @@ -1206,13 +1330,13 @@ self.line43 = QtWidgets.QLineEdit() self.line43.setPlaceholderText(str(ui.cache_pause_seconds) + ' (In Seconds)') - msg = '<html>Stop this many seconds before starting out again when run\ + msg = '<html>Pause this many seconds before starting out again when run\ out of cache</html>' self.text43 = QtWidgets.QLabel() self.text43.setText("Cache Pause Seconds") self.text43.setToolTip(msg) self.player_list.append('cache_pause_seconds') - + """ self.line44 = QtWidgets.QLineEdit() if len(ui.playback_engine) > 2: extra_players = [i for i in ui.playback_engine if i not in ['mpv', 'mplayer', 'libmpv']] @@ -1232,6 +1356,19 @@ self.text44.setText("Extra Players") self.text44.setToolTip(msg) self.player_list.append('playback_engine') + """ + + self.line44 = QtWidgets.QComboBox() + self.line44.addItem("False") + self.line44.addItem("True") + index = self.line44.findText(str(ui.playlist_continue)) + self.line44.setCurrentIndex(index) + self.text44 = QtWidgets.QLabel() + self.text44.setText("Playlist Continue") + self.player_list.append('playlist_continue') + msg = 'True: Allow playback of next playlist entry automatically (default).\n\ + False: stop playback once file end has reached, meaning only one file will be played.' + self.text44.setToolTip('<html>{}</html>'.format(msg)) self.line45 = QtWidgets.QLineEdit() self.line45.setPlaceholderText("{}".format(ui.screenshot_directory)) @@ -1501,17 +1638,14 @@ i = '' if i and i not in ui.mpvplayer_string_list: ui.mpvplayer_string_list.append('--'+i) - if i and ui.player_val == "libmpv": - if "=" in i: - k, v = i.split('=', 1) - else: - k = i - v = True - k = k.replace('-', '_') - ui.tab_5.args_dict.update({k:v}) - if hasattr(ui.tab_5.mpv, k): - setattr(ui.tab_5.mpv, k, v) - print("{}={}".format(k, v)) + + if ui.player_val == "libmpv" and hasattr(ui.tab_5, "mpv") and ui.use_custom_config_file: + ui.tab_5.create_args_dict() + for k, v in ui.tab_5.args_dict.items(): + if isinstance(v, bool): + v = "yes" if v else "no" + k = k.replace("_", "-") + ui.tab_5.mpv.set_property(k, v) write_files(self.config_file_name, mpv_cmd, line_by_line=True) mpv_cmd_dict.update({'file':mpv_cmd}) mpv_cmd_dict.update({'str':ui.mpvplayer_string_list}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/stylesheet.py new/kawaii-player-4.2.0-1/kawaii_player/stylesheet.py --- old/kawaii-player-4.1.0-1/kawaii_player/stylesheet.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/stylesheet.py 2019-07-12 21:09:25.000000000 +0200 @@ -60,7 +60,7 @@ gui.list2.setStyleSheet(""" QListWidget{{ color:{1};background:rgba(0,0,0,30%);border:rgba(0,0,0,30%); - font: {bold} {font}; + font: {bold} {size}px {font}; }} QListWidget:item {{ height: {0}; @@ -91,7 +91,7 @@ background:rgba(0, 0, 0, 20%);border: rgba(0,0,0, 30%); }} """.format(height, gui.list_text_color, gui.list_text_color_focus, - bold=font_bold, font=gui.global_font) + bold=font_bold, font=gui.global_font, size=gui.global_font_size) ) def qmenu_style(self, widget): @@ -360,7 +360,7 @@ color: {color}; selection-color:yellow;background:rgba(0,0,0,{btn}); border:rgba(0, 0, 0, 10%); - padding: 2px 0px 2px 4px; + padding: 0px 2px 0px 4px; font: {bold}; max-height: 40px; }} @@ -368,6 +368,7 @@ background-color: rgba(54,60,74); border-radius: 0px; color: {color}; + padding: 0px 2px 0px 4px; font: {bold} {font}; }} QComboBox::hover{{background-color: rgba(0,0,0,40%);color: {color};}} @@ -643,9 +644,12 @@ height = '128px' else: height = '{}px'.format(gui.global_font_size*3) + red, green, blue = gui.bg_color_widget_dark_theme + redc, greenc, bluec = gui.bg_color_control_frame + redm, greenm, bluem = gui.bg_color_dark_theme gui.list2.setStyleSheet("""QListWidget{{ - color:{1};background:rgba(0,0,0,30%);border:rgba(0,0,0,30%); - font: {bold} ; + color:{1};background:rgba({red},{green},{blue},30%);border:rgba(0,0,0,30%); + font: {bold} {size}px {font}; }} QListWidget:item {{ height: {0}; @@ -656,17 +660,17 @@ }} QListWidget:item:inactive {{ color:{1};background:rgba(0,0,0,0%);border:rgba(0,0,0,0%); - font: {bold} ; + font: {bold} {size}px {font}; }} QMenu{{ color: white; - background: rgb(56,60,74);border: rgba(0,0,0, 30%); + background: rgba({redm}, {greenm}, {bluem}, 50%);border: rgba(0,0,0, 30%); padding: 2px; }} QMenu::item{{ - font: {font}; + font: {font} {size}px {font}; color: {1}; - background:rgb(56,60,74);border: rgba(0,0,0, 30%); + background:rgba({redm}, {greenm}, {bluem}, 50%);border: rgba(0,0,0, 30%); padding: 4px; margin: 2px 2px 2px 10px; }} QMenu::item:selected{{ @@ -674,7 +678,9 @@ background:rgba(0, 0, 0, 20%);border: rgba(0,0,0, 30%); }} """.format(height, gui.list_text_color, gui.list_text_color_focus, - bold=font_bold, font=gui.global_font) + bold=font_bold, font=gui.global_font, size=gui.global_font_size, + red=red, blue=blue, green=green, + redm=redm, bluem=bluem, greenm=greenm) ) if widget != gui.list2: for widget_item in ([gui.line, gui.text, gui.cover_label, gui.frame1, gui.frame, @@ -684,17 +690,22 @@ alpha = '20%' else: alpha = '30%' - if widget == gui.frame1: - font_size = '11px' + if widget_item == gui.frame1: + font_size = '10px' if not font_bold: font_size = '' + redt, greent, bluet = (redc, greenc, bluec) else: font_size = '' + redt, greent, bluet = (red, green, blue) widget_item.setStyleSheet(""" color:{color}; - font: {bold} {size}; - background:rgba(0,0,0,{alpha});border:rgba(0,0,0,{alpha}); - """.format(alpha=alpha, color=gui.list_text_color, bold=font_bold, size=font_size)) + font: {bold} {size}px {font}; + background:rgba({red},{green},{blue},{alpha});border:rgba(0,0,0,{alpha}); + """.format(alpha=alpha, color=gui.list_text_color, font=gui.global_font, + bold=font_bold, size=gui.global_font_size, + red=redt, green=greent, blue=bluet) + ) for frame in [gui.frame2, gui.frame_web, gui.dockWidget_3, gui.goto_epn, gui.frame_extra_toolbar.child_frame, gui.frame_extra_toolbar.tab_frame, gui.frame_extra_toolbar.subtitle_frame]: @@ -715,24 +726,24 @@ min_height = 'max-height: 30px' frame.setStyleSheet(""" - QFrame{{color:white;background:rgba(0,0,0,{alpha});border:rgba(0,0,0,{alpha});}} + QFrame{{color:white;background:rgba({red},{green},{blue},{alpha});border:rgba(0,0,0,{alpha});}} QPushButton{{color:{color};background:rgba(0,0,0,{btn});border:rgba(0,0,0,{btn}); - {min_height}; font: {bold};}} + {min_height}; font: {bold} {size}px {font};}} QPushButton::hover{{background-color: yellow;color: black;}} QLineEdit{{ color:white;background:rgba(0,0,0,10%); - {min_height};border:rgba(0, 0, 0, 10%); font: {bold} + {min_height};border:rgba(0, 0, 0, 10%); font: {bold} {size}px {font}; }} QLabel{{ color:{color};background:rgba(0,0,0,{label_alpha}); - {min_height};border:rgba(0, 0, 0, {label_alpha});font: {bold}; + {min_height};border:rgba(0, 0, 0, {label_alpha});font: {bold} {size}px {font}; }} QComboBox {{ color: {color}; selection-color:yellow;background:rgba(0,0,0,{btn}); border:rgba(0, 0, 0, 10%); padding: 2px 0px 2px 4px; - font: {bold}; + font: {bold} {size}px {font}; }} QComboBox::hover{{background-color: rgba(0,0,0,60%);color: {color};}} QComboBox::drop-down {{ @@ -741,10 +752,10 @@ color:white; }} QComboBox QAbstractItemView{{ - background-color: rgb(54,60,74); + background-color: rgb({redm},{greenm},{bluem}); border-radius: 0px; color: {color}; - font: {bold}; + font: {bold} {size}px {font}; }} QComboBox::focus {{ background-color:rgba(0,0,0,60%);color: {focus}; @@ -756,7 +767,6 @@ QSlider:groove:horizontal {{ height: 8px; - border:rgba(0, 0, 0, 30%); background:rgba(0, 0, 0, 30%); margin: 2px 0; }} @@ -776,7 +786,7 @@ }} QCheckBox{{ color:{color};background:rgba(0,0,0,0%); - border:rgba(0, 0, 0, 10%); font: {bold} {font}; + border:rgba(0, 0, 0, 10%); font: {bold} {size}px {font}; {min_height}; }} QDoubleSpinBox{{ @@ -806,35 +816,42 @@ alpha=bg, btn=qbtn, color=gui.list_text_color, focus=gui.list_text_color_focus, bold=font_bold, size=gui.global_font_size, font=gui.global_font, - label_alpha=label_alpha, min_height=min_height + label_alpha=label_alpha, min_height=min_height, + red=red, green=green, blue=blue, + redm=redm, greenm=greenm, bluem=bluem, + size_label=gui.global_font_size+4 ) ) gui.player_opt.setStyleSheet(""" - QFrame{color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);} - QPushButton{max-height:64px;border:rgba(0, 0, 0, 30%)} - QPushButton::hover{background-color: yellow;color: black;} - """) + QFrame{{color:white;background:rgba({red},{green},{blue},30%);border:rgba(0,0,0,30%);}} + QPushButton{{max-height:64px; + background:rgba({red},{green},{blue},40%); + border:rgba(0, 0, 0, 30%); + font: {bold} {size}px {font};}} + QPushButton::hover{{background-color: yellow;color: black;}} + """.format(red=redc, green=greenc, blue=bluec, + bold=font_bold, size=gui.global_font_size, font=gui.global_font)) gui.settings_box.setStyleSheet(""" - QFrame{{color:white;background:rgba(0,0,0,{alpha});border:rgba(0,0,0,{alpha});}} + QFrame{{color:white;background:rgba({red},{green},{blue},{alpha});border:rgba(0,0,0,{alpha});}} QTabWidget{{ color:{color}; border:rgba(0,0,0,{alpha});background:rgb(56,60,74); background-color:rgba(0,0,0,{alpha}); }} QTabWidget:pane {{ - color:{color};font: {bold} {font}; + color:{color};font: {bold} {size}px {font}; border:rgba(0,0,0,{alpha});background:rgba(56,60,74, {alpha}); }} QTabBar {{ - color:{color};font: {bold} {font}; + color:{color};font: {bold} {size}px {font}; border:rgba(0,0,0,{alpha});background:rgba(56,60,74, {alpha}); background-color:rgba(0,0,0,{alpha}); }} QTabBar:tab{{ - color:{color};background:rgba(56,60,74, {alpha}); + color:{color};background:rgba({red},{green},{blue}, {alpha}); }} QTabBar:tab:selected{{ @@ -843,7 +860,7 @@ QListWidget{{ color:{color};background:rgba(0,0,0,30%);border:rgba(0,0,0,30%); - font: {bold} {font}; + font: {bold} {size}px {font}; }} QListWidget:item {{ height: 30px; @@ -854,12 +871,12 @@ }} QPushButton{{color:{color};background:rgba(0,0,0,{btn});border:rgba(0,0,0,{btn}); - max-height:40px; font: {bold};}} + max-height:40px; font: {bold} {size}px {font};}} QPushButton::hover{{background-color: yellow;color: black;}} QLineEdit{{color:{color};background:rgba(0,0,0,10%); - max-height:40px;border:rgba(0, 0, 0, 10%); font: {bold} {font};}} + max-height:40px;border:rgba(0, 0, 0, 10%); font: {bold} {size}px {font};}} QTextEdit{{color:{color};background:rgba(0,0,0,10%); - border:rgba(0, 0, 0, 10%); font: {bold} {font};}} + border:rgba(0, 0, 0, 10%); font: {bold} {size}px {font};}} QCheckBox{{color:{color};background:rgba(0,0,0,10%); border:rgba(0, 0, 0, 10%); font: {bold} {font};}} @@ -878,21 +895,21 @@ }} QLabel{{color:{color};background:rgba(0,0,0,0%); - max-height:40px;border:rgba(0, 0, 0, 10%);font: {bold} {font};}} + max-height:40px;border:rgba(0, 0, 0, 10%);font: {bold} {size}px {font};}} QComboBox {{ color: {color}; selection-color:yellow;background:rgba(0,0,0,{btn}); border:rgba(0, 0, 0, 10%); - padding: 2px 0px 2px 4px; - font: {bold}; + padding: 0px 2px 0px 4px; + font: {bold} {size}px {font}; max-height: 40px; }} QComboBox QAbstractItemView{{ - background-color: rgb(56,60,74); + background-color: rgb({redm},{greenm},{bluem}); border-radius: 0px; - border-color:rgb(56,60,74); + border-color:rgb({redm}, {greenm}, {bluem}); color: {color}; - font: {bold} {font}; + font: {bold} {size}px {font}; }} QComboBox::hover{{background-color: rgba(0,0,0,40%);color: {color};}} QComboBox::drop-down {{ @@ -909,26 +926,29 @@ }}""".format( alpha=bg, btn=qbtn, color=gui.list_text_color, focus=gui.list_text_color_focus, bold=font_bold, - size=gui.global_font_size, font=gui.global_font) + size=gui.global_font_size, font=gui.global_font, + red=red, blue=blue, green=green, + redm=redm, greenm=greenm, bluem=bluem, + size_label=gui.global_font_size+4) ) for widget in [gui.progress, gui.progressEpn]: - widget.setStyleSheet("""QProgressBar{ + widget.setStyleSheet("""QProgressBar{{ color:white; - background:rgba(0, 0, 0, 30%); + background:rgba({red}, {green}, {blue}, 30%); border:rgba(0, 0, 0, 1%) ; border-radius: 1px; - text-align: center;} + text-align: center;}} - QProgressBar:chunk { + QProgressBar:chunk {{ background-color:rgba(0,0,0,30%); width: 10px; margin: 0.5px; - }}""") + }}""".format(red=redc, green=greenc, blue=bluec)) gui.slider.setStyleSheet("""QSlider:groove:horizontal {{ height: 8px; border:rgba(0, 0, 0, 30%); - background:rgba(0, 0, 0, 30%); + background:rgba({red}, {green}, {blue}, 30%); margin: 2px 0; }} QSlider:handle:horizontal {{ @@ -942,20 +962,20 @@ QToolTip {{ font : {bold} {size}px {font}; color: {color}; - background:rgb(56,60,74); + background:rgb({red}, {green}, {blue}); padding: 1px 2px 1px 2px; }} """.format( alpha=bg, color=gui.list_text_color, - bold=font_bold, size=gui.global_font_size+3, - font=gui.global_font + bold=font_bold, size=gui.global_font_size, + font=gui.global_font, red=redc, green=greenc, blue=bluec ) ) gui.list_poster.setStyleSheet(""" QListWidget{{ color:{0}; - background:rgba(0, 0, 0, 35%);border:rgba(0, 0, 0, 35%); - font: {bold}; + background:rgba({red}, {green}, {blue}, 35%);border:rgba(0, 0, 0, 35%); + font: {bold} {size}px {font}; }} QListWidget:item {{ height: 312px; @@ -968,7 +988,7 @@ QListWidget:item:inactive {{ color:{0}; background:rgba(0, 0, 0, 0%);border:rgba(0, 0, 0, 0%); - font: {bold}; + font: {bold} {size}px {font}; }} QMenu{{ color: white; @@ -984,13 +1004,16 @@ color: {1}; background:rgba(0, 0, 0, 20%);border: rgba(0,0,0, 30%); }} - """.format(gui.thumbnail_text_color, gui.thumbnail_text_color_focus, bold=font_bold)) + """.format(gui.thumbnail_text_color, gui.thumbnail_text_color_focus, + size=gui.global_font_size, font=gui.global_font, + bold=font_bold, red=red, blue=blue, green=green) + ) #gui.VerticalLayoutLabel_Dock3.setSpacing(0) #gui.VerticalLayoutLabel_Dock3.setContentsMargins(5, 5, 5, 5) for widget in [gui.list1, gui.list3, gui.list4, gui.list5, gui.list6, gui.player_menu]: widget.setStyleSheet("""QListWidget{{ - color:{0};background:rgba(0,0,0,30%);border:rgba(0,0,0,30%); - font: {bold}; + color:{0};background:rgba({red},{green},{blue},30%);border:rgba(0,0,0,30%); + font: {bold} {size}px {font}; }} QListWidget:item {{ height: {height}px; @@ -1002,17 +1025,17 @@ QListWidget:item:inactive {{ color:{0};background:rgba(0,0,0,0%);border:rgba(0,0,0,0%); - font: {bold}; + font: {bold} {size}px {font}; }} QMenu{{ color: {1}; - background: rgb(56,60,74);border: rgba(0,0,0, 30%); + background: rgba({redm},{greenm},{bluem}, 50%);border: rgba(0,0,0, 30%); padding: 2px; }} QMenu::item{{ font: {font}; color: {0}; - background:rgb(56,60,74);border: rgba(0,0,0, 30%); + background:rgba({redm},{greenm},{bluem}, 50%);border: rgba(0,0,0, 30%); padding: 4px; margin: 2px 2px 2px 10px; }} QMenu::item:selected{{ @@ -1020,5 +1043,7 @@ background:rgba(0, 0, 0, 20%);border: rgba(0,0,0, 30%); }} """.format(gui.list_text_color, gui.list_text_color_focus, - bold=font_bold, font=gui.global_font, height=gui.global_font_size*3) + bold=font_bold, font=gui.global_font, height=gui.global_font_size*3, + red=red, green=green, blue=blue, size=gui.global_font_size, + redm=redm, greenm=greenm, bluem=bluem) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/widgets/optionwidgets.py new/kawaii-player-4.2.0-1/kawaii_player/widgets/optionwidgets.py --- old/kawaii-player-4.1.0-1/kawaii_player/widgets/optionwidgets.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/widgets/optionwidgets.py 2019-07-12 21:09:25.000000000 +0200 @@ -1390,9 +1390,8 @@ self.super_layout.setContentsMargins(0, 0, 0, 0) self.super_layout.setSpacing(0) self.tab_frame = QtWidgets.QFrame(self) - self.tab_frame.setStyleSheet('background:rgba(0,0,0,0)') self.tab_frame_layout = QtWidgets.QHBoxLayout(self.tab_frame) - self.tab_frame_layout.setSpacing(5) + self.tab_frame_layout.setSpacing(0) self.tab_frame_layout.setContentsMargins(5,5,5,5) self.general_tab_btn = QPushButtonExtra(self.tab_frame) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/widgets/playlist.py new/kawaii-player-4.2.0-1/kawaii_player/widgets/playlist.py --- old/kawaii-player-4.1.0-1/kawaii_player/widgets/playlist.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/widgets/playlist.py 2019-07-12 21:09:25.000000000 +0200 @@ -1299,7 +1299,8 @@ title = title.split(',', 1)[-1].strip() url = new_lines[row+1] try: - nurl = self.ui.if_path_is_rel(urllib.parse.urlparse(url).path[1:].rsplit('/', 1)[0], abs_path=True) + nurl = self.ui.if_path_is_rel(urllib.parse.urlparse(url).path[1:].rsplit('/', 1)[0], + abs_path=True, from_master=True) nurl_netloc = urllib.parse.urlparse(nurl).netloc if 'youtube.com' in nurl_netloc: url = nurl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/widgets/traywidget.py new/kawaii-player-4.2.0-1/kawaii_player/widgets/traywidget.py --- old/kawaii-player-4.1.0-1/kawaii_player/widgets/traywidget.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/widgets/traywidget.py 2019-07-12 21:09:25.000000000 +0200 @@ -307,10 +307,10 @@ self.addAction(self.h_mode) self.h_mode.setFont(QtGui.QFont('SansSerif', 10, italic=False)) - self.m_mode = QtWidgets.QAction("&Music Mode", self) - self.m_mode.triggered.connect(ui.music_mode_layout) - self.addAction(self.m_mode) - self.m_mode.setFont(QtGui.QFont('SansSerif', 10, italic=False)) + #self.m_mode = QtWidgets.QAction("&Music Mode", self) + #self.m_mode.triggered.connect(ui.music_mode_layout) + #self.addAction(self.m_mode) + #self.m_mode.setFont(QtGui.QFont('SansSerif', 10, italic=False)) self.v_mode = QtWidgets.QAction("&Video Mode", self) self.v_mode.triggered.connect(ui.video_mode_layout) @@ -394,6 +394,10 @@ ui.float_window_open = True if ui.mpvplayer_val.processId() > 0 or ui.player_val == "libmpv": ui.float_window.setWindowTitle(ui.epn_name_in_list) + if ui.fullscreen_video: + ui.frame_extra_toolbar.btn_fs_video.clicked_emit() + elif MainWindow.isFullScreen(): + ui.frame_extra_toolbar.btn_fs_window.clicked_emit() if txt.lower() == '&detach video': self.d_vid.setText('&Attach Video') if str(ui.idw) == ui.get_winid() or not ui.idw: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/kawaii_player/yt.py new/kawaii-player-4.2.0-1/kawaii_player/yt.py --- old/kawaii-player-4.1.0-1/kawaii_player/yt.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/kawaii_player/yt.py 2019-07-12 21:09:25.000000000 +0200 @@ -168,6 +168,8 @@ logger.debug('yt-link:>>{0}'.format(final_url)) if mode == 'TITLE' and not final_url: final_url = url.split('/')[-1] + elif not final_url: + final_url = url return final_url def get_final_for_resolution(self, url, youtube_dl, logger, ytdl_extra, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/setup.py new/kawaii-player-4.2.0-1/setup.py --- old/kawaii-player-4.1.0-1/setup.py 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/setup.py 2019-07-12 21:09:25.000000000 +0200 @@ -37,7 +37,7 @@ ] setup( name='kawaii-player', - version='4.1.0', + version='4.2.0', license='GPLv3', author='kanishka-linux', author_email='[email protected]', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kawaii-player-4.1.0-1/ubuntu/DEBIAN/control new/kawaii-player-4.2.0-1/ubuntu/DEBIAN/control --- old/kawaii-player-4.1.0-1/ubuntu/DEBIAN/control 2019-06-17 15:36:47.000000000 +0200 +++ new/kawaii-player-4.2.0-1/ubuntu/DEBIAN/control 2019-07-12 21:09:25.000000000 +0200 @@ -1,5 +1,5 @@ Package: kawaii-player -Version: 4.1.0-1 +Version: 4.2.0-1 Architecture: all Maintainer: kanishka-linux Depends: python3, python3-pyqt5, python3-pycurl, python3-dbus, python3-pil, python3-bs4, python3-lxml, python3-taglib, python3-pip, curl, libnotify-bin, mpv, mplayer, ffmpegthumbnailer, sqlite3, python3-libtorrent, wget, python3-dbus.mainloop.pyqt5, python3-pyqt5.qtwebkit, python3-mutagen, python3-opengl, python3-pyqt5.qtopengl, libmpv-dev
