Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] allow QR to point to an .setup.json address #1

Closed
Merith-TK opened this issue Jun 16, 2022 · 4 comments
Closed

[feature] allow QR to point to an .setup.json address #1

Merith-TK opened this issue Jun 16, 2022 · 4 comments

Comments

@Merith-TK
Copy link
Contributor

basically, the thought process is that it can be used to point to an "setup.json" rather than an normal file

kinda like

{
  "dsidl" : {
    "files" : [
      "/data/config.txt" : "http://example.com/data/config.txt",
      "/program.nds" : "http://example.com/data/program.nds",
    ]
  }
}

where it then prompts the user that this is an multi-download QR, and then were they want this data saved (select for all or for single file at an time)

@Epicpkmn11
Copy link
Owner

Added (though in a slightly different way) in e1f665b

What I did is put the JSON right into the QR itself as my goal in this is to a very simplistic downloader and that's simpler imo.

It supports either arrays or objects, with arrays simply being a list of URLs that it prompts the user for location/name like normal and objects allowing you to set both the URL and the output path. Examples:

[
    "It'll print anything that doesn't start 'http'",
    "https://example.com",
    "http://uwu.xn--rck9c.xn--tckwe",
    "Thanks for downloading!"
]

{
    "sd:/example.html": "https://example.com",
    "": "Comments still work",
    "sd:/uwu.html": "http://uwu.xn--rck9c.xn--tckwe"
}

@Epicpkmn11
Copy link
Owner

Added external scripts in cc5b3a4, I did it a little differently as I don't particularly like relying on file extensions so to start one you put this in a QR:

{"dsidl:src": "https://example.test/script.json"}

("dsidl:src" was chosen since : makes it an invalid FAT path)

then the script file is:

{
    "dsidl": 1,
    "script": {
        "/program.nds": "http://example.test/data/program.nds"
    }
}

or such, with "dsidl" being a version number as a sanity check and incase it changes significantly in the future and "script" being the same as above, an object or array.

I did "script" instead of "files" since if I add unzipping I'll probably do it with either "sd:/file.zip": "unzip:/destination/path" or so or maybe making the items into objects so you can specify an action like in UU, imo works better together as then they can be mixed together in any order, download unzip download unzip or so.

@Merith-TK
Copy link
Contributor Author

Merith-TK commented Jun 16, 2022

Id say this is an fair compromise,

so you can have

{
   "/game.nds":"https://example.com/roms/game.nds",
   "dsidl:src":"https://example.com/roms/game.json",
}

and have game.json pont out an series of other files needed as well that may or may not update at some point?

EDIT: I am also working on making release-workflows for you so you can just write an new release and have an QR code that points to the latest release always

@Merith-TK
Copy link
Contributor Author

Merith-TK commented Jun 16, 2022

testing dsidl:src and it appears to work, however it does not prompt the user where they wish to have the file saved, and instead defaults to sd:/

opening new issue specifically for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants