Skip to content

Commit

Permalink
music detection fixed & internationalized
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Mar 24, 2023
1 parent 97962ae commit d625ba5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion js&css/web-accessible/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ImprovedTube.init = function () {

document.addEventListener('yt-navigate-finish', function () {
ImprovedTube.pageType();
ImprovedTube.commentsSidebarPosition();
ImprovedTube.commentsSidebar();

if (ImprovedTube.elements.player && ImprovedTube.elements.player.setPlaybackRate) {
ImprovedTube.videoPageUpdate();
Expand Down
2 changes: 1 addition & 1 deletion js&css/web-accessible/www.youtube.com/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ ImprovedTube.playerRemainingDuration = function () {
/*------------------------------------------------------------------------------
4.2.1.6 Comments position to sidebar
------------------------------------------------------------------------------*/
ImprovedTube.commentsSidebarPosition=()=>{ if(ImprovedTube.storage.comments_sidebar_position){
ImprovedTube.commentsSidebar=()=>{ if(ImprovedTube.storage.comments_sidebar){
document.querySelector("#columns").appendChild(document.querySelector("#comments"));

if(window.matchMedia("(max-width: 1598px)").matches)
Expand Down
10 changes: 5 additions & 5 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ ImprovedTube.playerPlaybackSpeed = function (change) {
if (this.storage.player_forced_playback_speed === true) {
if (player.getVideoData().isLive === false &&
(this.storage.player_force_speed_on_music === true ||
(document.querySelector('h3#title')?.innerText !== 'Music'
&& (ImprovedTube.genre !== 'Music' || /interview|back[- ]?stage/i.test(ImprovedTube.keywords + ImprovedTube.title) )
&& !/official (music )?video|lyrics|cover[\)\]]|[\(\[]cover|cover version|karaoke|(sing|play)[- ]?along/i.test(ImprovedTube.title + ImprovedTube.keywords)
&& location.href.indexOf('music') === -1
)
document.querySelector('h3#title')?.innerText !== 'Music' // (=buyable/registered music table)
|| (
(ImprovedTube.elements.genre !== 'Music' && !/official (music )?video|lyrics|cover[\)\]]|[\(\[]cover|cover version|karaok|(sing|play)[- ]?along|卡拉OK|卡拉OK|الكاريوكيкараоке|カラオケ|노래방/i.test(ImprovedTube.elements.title + ImprovedTube.elements.keywords)
) || /do[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(ImprovedTube.elements.keywords + ImprovedTube.elements.title)
) // && location.href.indexOf('music') === -1 // (=only running on www.youtube.com anyways)
)) {
player.setPlaybackRate(Number(option));
video.playbackRate = Number(option);
Expand Down
2 changes: 1 addition & 1 deletion menu/skeleton-parts/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ extension.skeleton.main.layers.section.appearance.on.click.comments = {
},
comments_sidebar_position: {
component: "switch",
text: "SidebarPosition",
text: "sidebar",
},
squared_user_images: {
component: 'switch',
Expand Down

0 comments on commit d625ba5

Please sign in to comment.