From e5f0dfa65a98830731d05fa19dadb33f3d7d547d Mon Sep 17 00:00:00 2001 From: awers24 <83694881+awers24@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:43:10 +0200 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20=D1=80=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D0=BE=D1=87=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B4=D0=BD=D1=8B=D1=85=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B9=20=D1=81=D0=B0=D0=B9=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/elements/createDownloadAudioButton/index.module.scss | 4 ++-- src/interactions/onAddAudioRowReact.ts | 8 +++----- .../audioPage/getAudioPlayerUserControlsContainer.ts | 2 +- src/modules/audioPage/index.ts | 2 +- src/modules/audioPlaylist/index.ts | 8 ++++---- src/modules/injectDownloadButtonInAudioRow/index.ts | 2 +- src/modules/showBitrateNearDuration/index.ts | 2 +- 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index fcb88ad..1dd3926 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vk-music-saver", - "version": "1.3.0", + "version": "1.3.1", "type": "module", "scripts": { "dev": "cross-env NODE_OPTIONS=\"--import=tsx/esm\" webpack serve --config webpack.config.ts --env --dev", diff --git a/src/elements/createDownloadAudioButton/index.module.scss b/src/elements/createDownloadAudioButton/index.module.scss index 3e6df18..e1f04b0 100644 --- a/src/elements/createDownloadAudioButton/index.module.scss +++ b/src/elements/createDownloadAudioButton/index.module.scss @@ -24,7 +24,7 @@ // плеер музыки :global(.AudioPlayerBlock__root), -:global([class^='AudioPlayerUserControlsContainer-module__userButtonsContainer--']) { +:global([class*='AudioPlayerUserControlsContainer__userButtonsContainer--']) { .DownloadAudioButton { transition: opacity 0.15s ease-out; opacity: 1; @@ -117,7 +117,7 @@ } } -:global([class*='AudioRow-module__root']) { +:global([class*='AudioRow__root']) { .DownloadAudioButton { display: flex; flex-direction: row-reverse; diff --git a/src/interactions/onAddAudioRowReact.ts b/src/interactions/onAddAudioRowReact.ts index a67ae19..d7e771a 100644 --- a/src/interactions/onAddAudioRowReact.ts +++ b/src/interactions/onAddAudioRowReact.ts @@ -13,7 +13,7 @@ type CallbackFunc = (el: HTMLElement, audio: AudioAudio | null) => void; const interaction = new InteractionListener(); -const AUDIO_ROW_SELECTOR = '[class*="AudioRow-module__root"]'; +const AUDIO_ROW_SELECTOR = '[class*="AudioRow__root"]'; const findApiAudio = (el: HTMLElement): AudioAudio | null => { const { props: audioRowProps } = getReactAttrs(el); @@ -50,9 +50,7 @@ const onCallback = (el: HTMLElement) => { }; const findAudioList = async () => { - for (const items of document.querySelectorAll( - '[class*="AudioListItems-module__root--"] > div' - )) { + for (const items of document.querySelectorAll('[class*="AudioListItems__root--"] > div')) { if (items._vms_mbs) continue; items._vms_mbs = new MutationObserver((mutations) => { @@ -79,7 +77,7 @@ const findAudioList = async () => { }; const findAllAudioRows = async (retry = 0) => { - if (document.querySelector(`.vkui__root .vkuiFlex [class*="Skeleton-module__skeleton"]`)) { + if (document.querySelector(`.vkui__root .vkuiFlex [class*="Skeleton__skeleton"]`)) { await delay(1000); return findAllAudioRows(retry + 1); } diff --git a/src/modules/audioPage/getAudioPlayerUserControlsContainer.ts b/src/modules/audioPage/getAudioPlayerUserControlsContainer.ts index c17c88a..84be482 100644 --- a/src/modules/audioPage/getAudioPlayerUserControlsContainer.ts +++ b/src/modules/audioPage/getAudioPlayerUserControlsContainer.ts @@ -6,7 +6,7 @@ const getAudioPlayerUserControlsContainer = async (root: HTMLElement, retryCount } const container = root.querySelector( - '[class^="AudioPlayerUserControlsContainer-module__userButtonsContainer--"]' + '[class*="AudioPlayerUserControlsContainer__userButtonsContainer--"]' ); if (!container) { diff --git a/src/modules/audioPage/index.ts b/src/modules/audioPage/index.ts index 91db338..b75e725 100644 --- a/src/modules/audioPage/index.ts +++ b/src/modules/audioPage/index.ts @@ -85,7 +85,7 @@ const initAudioPage = () => { onOpenPlaylistPage(() => { for (const wrap of document.querySelectorAll( - '[data-testid="audioplayerblocksectionslayout"],[class*="AudioPlayerBlockSectionsLayout-module__root"]' + '[data-testid="audioplayerblocksectionslayout"],[class*="AudioPlayerBlockSectionsLayout__root"]' )) { onAddPlayer(wrap); } diff --git a/src/modules/audioPlaylist/index.ts b/src/modules/audioPlaylist/index.ts index a461c0d..f9200af 100644 --- a/src/modules/audioPlaylist/index.ts +++ b/src/modules/audioPlaylist/index.ts @@ -137,12 +137,12 @@ const injectToAudioPlaylistPageNew = async (retry = 0) => { const spaRoot = document.getElementById('spa_root'); if (!spaRoot) return; - if (spaRoot.querySelector(`[class*="Skeleton-module__skeleton"]`)) { + if (spaRoot.querySelector(`[class*="Skeleton__skeleton"]`)) { await delay(1000); return injectToAudioPlaylistPageNew(retry + 1); } - const actions = spaRoot.querySelector('[class*="AudioListHeader-module__actions--"]'); + const actions = spaRoot.querySelector('[class*="AudioListHeader__actions--"]'); if (!actions) return; if (actions.vms_down_inj) return; actions.vms_down_inj = true; @@ -179,13 +179,13 @@ const injectToAudioPlaylistPageNew = async (retry = 0) => { }; const injectToAudioPlaylistModalNew = async (playlistFullId: string, retry = 0) => { - if (document.querySelector(`.vkui__root .vkuiFlex [class*="Skeleton-module__skeleton"]`)) { + if (document.querySelector(`.vkui__root .vkuiFlex [class*="Skeleton__skeleton"]`)) { await delay(1000); return injectToAudioPlaylistModalNew(playlistFullId, retry + 1); } for (const actions of document.querySelectorAll( - '[class*="AudioListModalHeader-module__actions--"]' + '[class*="AudioListModalHeader__actions--"]' )) { if (!actions) return; if (actions.vms_down_inj) return; diff --git a/src/modules/injectDownloadButtonInAudioRow/index.ts b/src/modules/injectDownloadButtonInAudioRow/index.ts index 3616523..53558fb 100644 --- a/src/modules/injectDownloadButtonInAudioRow/index.ts +++ b/src/modules/injectDownloadButtonInAudioRow/index.ts @@ -97,7 +97,7 @@ const onAddReactRow = async (audioRow: HTMLElement, audio: AudioAudio | null) => return; } - const actions = audioRow.querySelector('[class*="AudioRow-module__actions--"]'); + const actions = audioRow.querySelector('[class*="AudioRow__actions--"]'); if (!actions) return; if (actions._vms_inj) return; actions._vms_inj = true; diff --git a/src/modules/showBitrateNearDuration/index.ts b/src/modules/showBitrateNearDuration/index.ts index 259c009..1cca9ee 100644 --- a/src/modules/showBitrateNearDuration/index.ts +++ b/src/modules/showBitrateNearDuration/index.ts @@ -62,7 +62,7 @@ const onAddRow = async (row: HTMLElement) => { const onAddRowReact = async (row: HTMLElement, audio: AudioAudio | null) => { if (!audio) return; - const rowAfter = row.querySelector(`[class*="AudioRow-module__after--"]`); + const rowAfter = row.querySelector(`[class*="AudioRow__after--"]`); if (!rowAfter) return; if (rowAfter.getElementsByClassName(styles.audioRow__bitrate).length) {