Rafiuth / Soggfy

Spotify ogg dumper
Creative Commons Zero v1.0 Universal
880 stars 53 forks source link

Mod spicetify and soggfy not working together #56

Open Masterload1975 opened 1 year ago

Masterload1975 commented 1 year ago

I installed it with the readme manual install.

But cant get soggfy working with spicetify.

Rafiuth commented 1 year ago

Seems like Spicetify removes some html attributes which soggfy uses to find them. There are other UI issues that I don't feel like fixing right now, but in the mean time you can apply this patch in Soggfy.js to get it mostly working (untested with themes):

@@ -1531,10 +1531,10 @@ ${StatusIcons[info.status]}`;
         let kind = container.getAttribute("data-testid");
         let isPlaylist = ["enhanced-page", "playlist-page"].includes(kind);
         let isAlbum = kind === "album-page";
-        rows ??= container.querySelectorAll('div[data-testid="tracklist-row"]');
+        rows ??= container.querySelectorAll('div[data-testid="tracklist-row"], .main-trackList-trackListRow');
         for (let row of rows) {
             let albumName = isAlbum ? listTitle : row.querySelector('a[href^="/album"]')?.innerText;
-            let menuBtn = row.querySelector('[data-testid="more-button"]');
+            let menuBtn = row.querySelector('[data-testid="more-button"], .main-trackList-rowMoreButton');
             if (albumName == null || menuBtn == null)
                 continue;
             let extraProps = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].getReactProps(row, menuBtn).menu.props;
@@ -1661,7 +1661,7 @@ class UI {
         bodyObs.observe(document.body, { childList: true, subtree: true });
     }
     addTopbarButtons() {
-        let fwdButton = document.querySelector("[data-testid='top-bar-forward-button']");
+        let fwdButton = document.querySelector("[data-testid='top-bar-forward-button'], .main-topBar-forward");
         let topbarContainer = fwdButton.parentElement;
         let buttonClass = fwdButton.classList[0];
         let div = document.createElement("div");