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 REQUEST] export collections to .osdb, merge collections with the same name via cli #65

Open
Bestfast opened this issue Jul 17, 2022 · 6 comments

Comments

@Bestfast
Copy link

as title suggests, export collections to .osdb given set name (and if none are given, just export every collection in current working directory) and merge collections to existing osu!collection or output file (eg. collection.osdb)

The main focus of this request would be the one to share maps with ease using command line. Doing that people could share collections with the same name (eg. "DT.osdb") and merge it with other people collection in a community.
The idea was:

  • People share their collection and send it to a webserver
  • Server receives the collections and merge it to the existing one
  • People can download the shared collection at any time from our webserver

I know this might be out of scope of the program, but it'd be very useful if it was possible to do so.

@Piotrekol
Copy link
Owner

Piotrekol commented Jul 18, 2022

just to clarify, there are 2 requests here?

  • exporting single collection from collection file(.db/.osdb) containing multiple collections inside to a separate file
  • merging of 2 collection files(.db/.osdb) and contacting maps contained if collection name conflicts occur

@Bestfast
Copy link
Author

Exactly, 2 requests. Both of them should be achievable by cli.
Eg:

App.exe --input a.osdb b.osdb c.osdb --output merge.osdb

App.exe --input collections.osdb --extract

That's how ideally I'd like it to work, but you might have better ideas.
Let me know if you need more infos, and obviously thanks in advance.

@Bestfast
Copy link
Author

also somewhat related
are there any docs related to .osdb files? or any way to extract beatmap informations from a .osdb to an human readable text (be it database, plain text, json etc)?

@Piotrekol
Copy link
Owner

Piotrekol commented Jul 21, 2022

App.exe --input a.osdb b.osdb c.osdb --output merge.osdb

looks resoanable

App.exe --input collections.osdb --extract

not sure what this would end up doing? extracting all collections to separate .osdb files(or .db, depending on input)?

Instead, I would image something like App.exe --input collections.osdb --extract collectionName1 collectionName2 collectionName3 --output C:\someFolder and maybe another command that would just extract collection names from file App.exe --input collections.osdb --listNames, thoughts?


are there any docs related to .osdb files? or any way to extract beatmap informations from a .osdb to an human readable text (be it database, plain text, json etc)?

There are none at the moment. There's class responsible for reading and writing these if that helps - read method is a bit convoluted as it allows reading of pretty much all .osdb versions... as such if you end up analyzing it I'd suggest following WriteOsdb method for reading data.

@Bestfast
Copy link
Author

Instead, I would image something like App.exe --input collections.osdb --extract collectionName1 collectionName2 collectionName3 --output C:\someFolder and maybe another command that would just extract collection names from file App.exe --input collections.osdb --listNames, thoughts?

Yea this looks much better I'd say. I don't think an --extractAll is needed (and if it is, people can always process --listNames output with grep).

as such if you end up analyzing it I'd suggest following WriteOsdb method for reading data.

I see. I was thinking about processing .osdb files with Python (eg. extracting at least the beatmapID so that I can look it up on the website, and if possible more info like Title and diffname), but I guess I'll figure something out myself.
I never worked with C#, so that will be a bit trivial. Thanks for the hint though!

@Bestfast
Copy link
Author

Bestfast commented Oct 11, 2022 via email

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

No branches or pull requests

2 participants