[GH-ISSUE #20] Offline mode support #18

Closed
opened 2026-02-27 15:47:56 +03:00 by kerem · 5 comments
Owner

Originally created by @YehudaEi on GitHub (Mar 2, 2022).
Original GitHub issue: https://github.com/Rafiuth/Soggfy/issues/20

No, this is not a duplication of #19 .

I wanted to ask if in case the songs already exist on the computer offline, is it possible to cancel the requests to Spotify's server (because then it blocks me after some time).
The information should be stored locally on the computer, and there is no need to make a new request to the server.

Thanks.

Originally created by @YehudaEi on GitHub (Mar 2, 2022). Original GitHub issue: https://github.com/Rafiuth/Soggfy/issues/20 No, this is not a duplication of #19 . I wanted to ask if in case the songs already exist on the computer offline, is it possible to cancel the requests to Spotify's server (because then it blocks me after some time). The information should be stored locally on the computer, and there is no need to make a new request to the server. Thanks.
kerem closed this issue 2026-02-27 15:47:57 +03:00
Author
Owner

@YehudaEi commented on GitHub (Mar 2, 2022):

I now looked at the code and saw that only some of the information was saved.
I understand that this question is irrelevant (I myself edited the js so that he would not make a request, and I give up this information).

<!-- gh-comment-id:1057020887 --> @YehudaEi commented on GitHub (Mar 2, 2022): I now looked at the code and saw that only some of the information was saved. I understand that this question is irrelevant (I myself edited the js so that he would not make a request, and I give up this information).
Author
Owner

@WhEntrecote commented on GitHub (Mar 3, 2022):

If you solved it, can you share?

<!-- gh-comment-id:1057774757 --> @WhEntrecote commented on GitHub (Mar 3, 2022): If you solved it, can you share?
Author
Owner

@YehudaEi commented on GitHub (Mar 7, 2022):

I edited the "getTrackMetaProps" function (attached below code).
In addition, I wrote a script in AutoIt3 that reopen Spotify when she crashes (for me it would happen when I was there at high speed).

async getTrackMetaProps(track) {
        let meta = track.metadata;
        let testArt = [meta.artist_name];
        for(let i = 1; true; i++){
            if(meta["artist_name:" + i] != undefined){
                testArt.push(meta["artist_name:" + i]);
            }
            else{
                break;
            }
        }
        document.getElementById("console").innerText = testArt.toString();
        //let extraMeta = await _resources__WEBPACK_IMPORTED_MODULE_2__["default"].getTrackMetadataWG(track.uri);
        let { year, month, day } = [0, 0, 0];//extraMeta.album.date;
        let date = [year, month, day];
        //Truncate date to available precision
        if (!day)
            date.pop();
        if (!month)
            date.pop();
        return {
            title: meta.title,
            album_artist: meta.artist_name,
            album: meta.album_title,
            artist: testArt.join("/"), //extraMeta.artist.map(v => v.name).join("/"),
            track: meta.album_track_number,
            totaltracks: meta.album_track_count,
            disc: meta.album_disc_number,
            totaldiscs: meta.album_disc_count,
            date: date.map(x => _utils__WEBPACK_IMPORTED_MODULE_0__["default"].padInt(x, 2)).join('-'),
            publisher: "YE Software ~ Soggfy", //extraMeta.album.label,
            language: undefined, //extraMeta.language_of_performance?.[0],
            isrc: undefined, //extraMeta.external_id.find(v => v.type === "isrc")?.id,
            comment: _resources__WEBPACK_IMPORTED_MODULE_2__["default"].getOpenTrackURL(track.uri),
            explicit: meta.is_explicit ? "1" : undefined
        };
    }
<!-- gh-comment-id:1060742587 --> @YehudaEi commented on GitHub (Mar 7, 2022): I edited the "getTrackMetaProps" function (attached below code). In addition, I wrote a script in AutoIt3 that reopen Spotify when she crashes (for me it would happen when I was there at high speed). ```js async getTrackMetaProps(track) { let meta = track.metadata; let testArt = [meta.artist_name]; for(let i = 1; true; i++){ if(meta["artist_name:" + i] != undefined){ testArt.push(meta["artist_name:" + i]); } else{ break; } } document.getElementById("console").innerText = testArt.toString(); //let extraMeta = await _resources__WEBPACK_IMPORTED_MODULE_2__["default"].getTrackMetadataWG(track.uri); let { year, month, day } = [0, 0, 0];//extraMeta.album.date; let date = [year, month, day]; //Truncate date to available precision if (!day) date.pop(); if (!month) date.pop(); return { title: meta.title, album_artist: meta.artist_name, album: meta.album_title, artist: testArt.join("/"), //extraMeta.artist.map(v => v.name).join("/"), track: meta.album_track_number, totaltracks: meta.album_track_count, disc: meta.album_disc_number, totaldiscs: meta.album_disc_count, date: date.map(x => _utils__WEBPACK_IMPORTED_MODULE_0__["default"].padInt(x, 2)).join('-'), publisher: "YE Software ~ Soggfy", //extraMeta.album.label, language: undefined, //extraMeta.language_of_performance?.[0], isrc: undefined, //extraMeta.external_id.find(v => v.type === "isrc")?.id, comment: _resources__WEBPACK_IMPORTED_MODULE_2__["default"].getOpenTrackURL(track.uri), explicit: meta.is_explicit ? "1" : undefined }; } ```
Author
Owner

@owovin commented on GitHub (Apr 26, 2022):

i find that the snippet you have written above does not properly work, in the version provided in the readme (version 1.1.84.716), the written code ends up erroring out:
[DBG] Requesting metadata for playback 395498fa6bcefdf3e58b8be7b51971e2... [INF] Discarding playback 395498fa6bcefdf3e58b8be7b51971e2: Cannot set properties of null (setting 'innerText')
commenting out the innertext works fine, but then it still depends on making fetch to the spotify servers to obtain metadata, of which is undesirable since i want to run this without any connection to the spotify servers
if you have any clue on how to fix this, that would be nice, thank you!

<!-- gh-comment-id:1110223210 --> @owovin commented on GitHub (Apr 26, 2022): i find that the snippet you have written above does not properly work, in the version provided in the readme (version 1.1.84.716), the written code ends up erroring out: `[DBG] Requesting metadata for playback 395498fa6bcefdf3e58b8be7b51971e2... [INF] Discarding playback 395498fa6bcefdf3e58b8be7b51971e2: Cannot set properties of null (setting 'innerText')` commenting out the innertext works fine, but then it still depends on making fetch to the spotify servers to obtain metadata, of which is undesirable since i want to run this without any connection to the spotify servers if you have any clue on how to fix this, that would be nice, thank you!
Author
Owner

@Rafiuth commented on GitHub (Apr 27, 2022):

I think commenting out document.getElementById("console").innerText = testArt.toString(); will work just fine,
let extraMeta = await _resources__WEBPACK_IMPORTED_MODULE_2__["default"].getTrackMetadataWG(track.uri); is the line making the extra request, which is already commented out in the snippet.

(that request will almost always be cached, since Spotify always makes it whenever a song starts playing for some reason).

<!-- gh-comment-id:1110381572 --> @Rafiuth commented on GitHub (Apr 27, 2022): I think commenting out `document.getElementById("console").innerText = testArt.toString();` will work just fine, `let extraMeta = await _resources__WEBPACK_IMPORTED_MODULE_2__["default"].getTrackMetadataWG(track.uri);` is the line making the extra request, which is already commented out in the snippet. (that request will almost always be cached, since Spotify always makes it whenever a song starts playing for some reason).
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Soggfy#18
No description provided.