Menu

#681 Cards with Cryfall id break

Bug
closed
nobody
None
8
2025-05-13
2025-02-09
No
card fails to save on windows with the filename contains the ":".
is an invalid character in filenames. this breaks all recent sets since they save the cards with a scryfall id.
1 Attachments

Discussion

  • Jason Grammenos

    Jason Grammenos - 2025-02-14

    I found a hacky fix for the issue:
    cardCache.java

        public static String createLocalImageFilePath(String cardId, String abbr) {
            String editionAbbr = abbr;
            if (abbr == null)
                editionAbbr = "unknown";
            else if (abbr.equals("CON")) // special hack for windows, which cannot
                                            // create CON directory
                editionAbbr = "CONFL";
            String part;
            if (cardId == null) {
                part = "Cards/0.jpg";
            } else {
                part = "Cards/" + editionAbbr + "/" + "EN" + "/Card" + cardId.replace(":", "_") + ".jpg"; // XXX
                                                                                        // remove
                                                                                        // EN
            }
            return new File(FileUtils.getStateLocationFile(), part).getPath();
        }
    

    the following was added to fix the issue

    cardId.replace(":", "_")
    
     
  • Jason Grammenos

    Jason Grammenos - 2025-03-31

    Here is a video showing the error in the left hand panel when selecting particular cards

     
  • BlueCurler

    BlueCurler - 2025-04-06

    Hi Jason, can you confirm if the recent fix address that bug or not?

     
  • Jason Grammenos

    Jason Grammenos - 2025-04-06

    this is still present on the most recent release.
    Windows files cannot contain the ":" character

     
    • BlueCurler

      BlueCurler - 2025-04-20

      a new fix has been done. Please, confirm this is working ok now.

       
  • Anonymous

    Anonymous - 2025-04-09

    I don't think the Cardscry: is even need for the names. The number after the : is all the is need to keep the pictures seperate from each other.

     
  • BlueCurler

    BlueCurler - 2025-04-19

    I confirm, this really seems the root cause. I will take a look an come back soon I hope.

     
  • Jason Grammenos

    Jason Grammenos - 2025-04-20

    I can confirm that I can no longer reproduce the bug in version

    magicassistant-1.5.2.202504201529-win32.win32.x86_64
    

    there are other buggy behaviours ("status update failed"), but this ticket is fixed and can be closed

     
  • BlueCurler

    BlueCurler - 2025-05-13
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB