Added to Library error

Member
Joined
Sep 21, 2020
Messages
53
I've been sorting through my library and I think I have discovered a bug. Where a manga will say "Add to Library" or "Reading" or "Completed" instead it reads "Added to Library" with the bell and checkmark. The thing is that I have no way to see these manga, they don't show up in my library under any category. I would like to know if anyone has encountered this before, and or if there is a way to easily see all of the manga under this.
 
Solution
I've been sorting through my library and I think I have discovered a bug. Where a manga will say "Add to Library" or "Reading" or "Completed" instead it reads "Added to Library" with the bell and checkmark. The thing is that I have no way to see these manga, they don't show up in my library under any category. I would like to know if anyone has encountered this before, and or if there is a way to easily see all of the manga under this.

With the advent of CustomLists on the horizon it's possible that this is a pointless endeavor as it might fix all the entries during the transition.. however, i was too curious to see how many i had since i'd seen them before and so i set out and wrote a short script which you can use if...
File Attacher
Staff
Super Moderator
Joined
Jan 20, 2018
Messages
273
I've been sorting through my library and I think I have discovered a bug. Where a manga will say "Add to Library" or "Reading" or "Completed" instead it reads "Added to Library" with the bell and checkmark. The thing is that I have no way to see these manga, they don't show up in my library under any category. I would like to know if anyone has encountered this before, and or if there is a way to easily see all of the manga under this.

With the advent of CustomLists on the horizon it's possible that this is a pointless endeavor as it might fix all the entries during the transition.. however, i was too curious to see how many i had since i'd seen them before and so i set out and wrote a short script which you can use if you wish
(I had 11, but also an old account following a bit over 2k series)

This will most DEFINITELY break once the CustomLists are actually out so don't use it at that point..

To use, on a mangadex.org tab where you're logged in, open the devtools (typically f12 or rightclick somewhere > inspect element ) and go to the Console and copy paste the below code and press enter, this will automatically try and fix the affected series by setting them to reading, if you don't want that and just want links to them then remove the for ... loop at the bottom (starting from the beginning of for(let uuid of diff){ to and including the } just above the console.log('\nDone!'))
JavaScript:
(async () => {
    console.log('Grabbing Statuses.');
    let _token = JSON.parse(localStorage.getItem("oidc.user:https://auth.mangadex.org/realms/mangadex:mangadex-frontend-stable")).access_token;
    let statusRes = (await (await fetch("https://api.mangadex.org/manga/status",{headers:{Authorization:"Bearer "+_token}})).json());
    let statuses = Object.keys(statusRes.statuses);
    await new Promise((rs)=>{setTimeout(rs,200)});
    
    console.log('Grabbing Follows:\n ');
    let _offset, _resTotal;
    _offset = _resTotal    = 0;
    let follows = [];
    do{
            let rls = Date.now();
            let res = (await (await fetch("https://api.mangadex.org/user/follows/manga?limit=100&offset="+_offset,{headers:{Authorization:"Bearer "+_token}})).json());
            _resTotal = res.total;
            follows.push(...res.data.map(m => m.id))
            _offset += 100;
            console.log('Follows %o/%o',Math.min(_offset,_resTotal),_resTotal)
            if(res.data.length == 0) _offset++;
            let rld = Date.now() - rls;
            if(rld < 200) await new Promise((rs)=>{setTimeout(rs,200-rld)});
    }while(_resTotal - _offset > 0)
    console.log(' ')
    let diff = follows.filter(id => !statuses.includes(id));
    
    console.log("Statuses: %o Follows: %o/%o (%o deleted entries?) Bugged Statuses: %o",statuses.length,follows.length,_resTotal,_resTotal-follows.length,diff.length);
    
    if(diff.length > 0){
        console.log("\n"+(diff.map(id => "https://mangadex.org/title/"+id).join('\n'))+'\n\nAttemping to set as Reading.\n ');
        for(let uuid of diff){
            let rls = Date.now();
            let res = (await fetch("https://api.mangadex.org/manga/"+uuid+"/status",{method: "POST", headers:{"Content-Type": "application/json", Authorization:"Bearer "+_token}, body: JSON.stringify({status:'reading'})}));
            console.log('*POST* for %s returned %o %s',uuid,res.status,(res.status==200)?'Fixed!':'Not Fixed.')
            let rld = Date.now() - rls;
            if(rld < 200) await new Promise((rs)=>{setTimeout(rs,200-rld)});
        }
        console.log('\nDone!')
    }
})()
 
Last edited:
Solution
Member
Joined
Sep 21, 2020
Messages
53
With the advent of CustomLists on the horizon it's possible that this is a pointless endeavor as it might fix all the entries during the transition.. however, i was too curious to see how many i had since i'd seen them before and so i set out and wrote a short script which you can use if you wish
(I had 11, but also an old account following a bit over 2k series)

This will most DEFINITELY break once the CustomLists are actually out so don't use it at that point..

To use, on a mangadex.org tab where you're logged in, open the devtools (typically f12 or rightclick somewhere > inspect element ) and go to the Console and copy paste the below code and press enter, this will automatically try and fix the affected series by setting them to reading, if you don't want that and just want links to them then remove the for ... loop at the bottom (starting from the beginning of for(let uuid of diff){ to and including the } just above the console.log('\nDone!'))
JavaScript:
{
    console.log('Grabbing Statuses.');
    let _token = JSON.parse(localStorage.getItem("oidc.user:https://auth.mangadex.org/realms/mangadex:mangadex-frontend-stable")).access_token;
    let statusRes = (await (await fetch("https://api.mangadex.org/manga/status",{headers:{Authorization:"Bearer "+_token}})).json());
    let statuses = Object.keys(statusRes.statuses);
    await new Promise((rs)=>{setTimeout(rs,200)});
   
    console.log('Grabbing Follows:\n ');
    let _offset, _resTotal;
    _offset = _resTotal    = 0;
    let follows = [];
    do{
            let rls = Date.now();
            let res = (await (await fetch("https://api.mangadex.org/user/follows/manga?limit=100&offset="+_offset,{headers:{Authorization:"Bearer "+_token}})).json());
            _resTotal = res.total;
            follows.push(...res.data.map(m => m.id))
            _offset += 100;
            console.log('Follows %o/%o',Math.min(_offset,_resTotal),_resTotal)
            if(res.data.length == 0) _offset++;
            let rld = Date.now() - rls;
            if(rld < 200) await new Promise((rs)=>{setTimeout(rs,200-rld)});
    }while(_resTotal - _offset > 0)
    console.log(' ')
    let diff = follows.filter(id => !statuses.includes(id));
   
    console.log("Statuses: %o Follows: %o/%o (%o deleted entries?) Bugged Statuses: %o",statuses.length,follows.length,_resTotal,_resTotal-follows.length,diff.length);
   
    if(diff.length > 0){
        console.log("\n"+(diff.map(id => "https://mangadex.org/title/"+id).join('\n'))+'\n\nAttemping to set as Reading.\n ');
        for(let uuid of diff){
            let rls = Date.now();
            let res = (await fetch("https://api.mangadex.org/manga/"+uuid+"/status",{method: "POST", headers:{"Content-Type": "application/json", Authorization:"Bearer "+_token}, body: JSON.stringify({status:'reading'})}));
            console.log('*POST* for %s returned %o %s',uuid,res.status,(res.status==200)?'Fixed!':'Not Fixed.')
            let rld = Date.now() - rls;
            if(rld < 200) await new Promise((rs)=>{setTimeout(rs,200-rld)});
        }
        console.log('\nDone!')
    }
}
This worked perfectly! Thank you so much!
 
Contributor
Joined
Apr 27, 2020
Messages
701
Hm. I have gotten a similar error with only certain specific series (such as this one). I can only have a reading status of None or it in this nebulous "Added to Library" status, which doesn't allow me to keep any of the selected statuses. I went to another series, and tested out if it was some broad error, but it doesn't appear to affect other series.

I tried clearing the status, logging out, swapping browsers, but it persists in Chrome and Firefox.
 
Contributor
Joined
Apr 27, 2020
Messages
701
With the advent of CustomLists on the horizon it's possible that this is a pointless endeavor as it might fix all the entries during the transition.. however, i was too curious to see how many i had since i'd seen them before and so i set out and wrote a short script which you can use if you wish
(I had 11, but also an old account following a bit over 2k series)

This will most DEFINITELY break once the CustomLists are actually out so don't use it at that point..

To use, on a mangadex.org tab where you're logged in, open the devtools (typically f12 or rightclick somewhere > inspect element ) and go to the Console and copy paste the below code and press enter, this will automatically try and fix the affected series by setting them to reading, if you don't want that and just want links to them then remove the for ... loop at the bottom (starting from the beginning of for(let uuid of diff){ to and including the } just above the console.log('\nDone!'))
JavaScript:
{
    console.log('Grabbing Statuses.');
    let _token = JSON.parse(localStorage.getItem("oidc.user:https://auth.mangadex.org/realms/mangadex:mangadex-frontend-stable")).access_token;
    let statusRes = (await (await fetch("https://api.mangadex.org/manga/status",{headers:{Authorization:"Bearer "+_token}})).json());
    let statuses = Object.keys(statusRes.statuses);
    await new Promise((rs)=>{setTimeout(rs,200)});
   
    console.log('Grabbing Follows:\n ');
    let _offset, _resTotal;
    _offset = _resTotal    = 0;
    let follows = [];
    do{
            let rls = Date.now();
            let res = (await (await fetch("https://api.mangadex.org/user/follows/manga?limit=100&offset="+_offset,{headers:{Authorization:"Bearer "+_token}})).json());
            _resTotal = res.total;
            follows.push(...res.data.map(m => m.id))
            _offset += 100;
            console.log('Follows %o/%o',Math.min(_offset,_resTotal),_resTotal)
            if(res.data.length == 0) _offset++;
            let rld = Date.now() - rls;
            if(rld < 200) await new Promise((rs)=>{setTimeout(rs,200-rld)});
    }while(_resTotal - _offset > 0)
    console.log(' ')
    let diff = follows.filter(id => !statuses.includes(id));
   
    console.log("Statuses: %o Follows: %o/%o (%o deleted entries?) Bugged Statuses: %o",statuses.length,follows.length,_resTotal,_resTotal-follows.length,diff.length);
   
    if(diff.length > 0){
        console.log("\n"+(diff.map(id => "https://mangadex.org/title/"+id).join('\n'))+'\n\nAttemping to set as Reading.\n ');
        for(let uuid of diff){
            let rls = Date.now();
            let res = (await fetch("https://api.mangadex.org/manga/"+uuid+"/status",{method: "POST", headers:{"Content-Type": "application/json", Authorization:"Bearer "+_token}, body: JSON.stringify({status:'reading'})}));
            console.log('*POST* for %s returned %o %s',uuid,res.status,(res.status==200)?'Fixed!':'Not Fixed.')
            let rld = Date.now() - rls;
            if(rld < 200) await new Promise((rs)=>{setTimeout(rs,200-rld)});
        }
        console.log('\nDone!')
    }
}
If I attempt that, I get the error: Uncaught SyntaxError: missing ) after argument list - debugger eval code:6:35
 
File Attacher
Staff
Super Moderator
Joined
Jan 20, 2018
Messages
273
If I attempt that, I get the error: Uncaught SyntaxError: missing ) after argument list - debugger eval code:6:35
Yeah, if you're not using chrome or edge (so chromium based i guess) it does that, only learned about that peculiarity like half a year ago, basically just need to wrap it in (async () => {})() and it should work, i'll edit the post, but regardless, in this situation it's not going to help unfortunately as
This title.. is simply broken as far as i know and the dev that can take a look at it has been busy for a while so not sure when one could give them a poke about it
 

Users who are viewing this thread

Top