alexpado / hoyoverse-music-unpacker

Extract music from Hoyoverse's games. Support Genshin Impact, Honkai Star Rail and Honkai Impact
70 stars 7 forks source link

Optional value for decompressing all audio files, not just music #19

Open avetharun opened 4 months ago

avetharun commented 4 months ago

-a, --all (default:false): allows any audio file to be supplied to the output folder *Note: folder size will be VERY large.

alexpado commented 4 months ago

Hi, Thanks for the PR !

I'd like to point out something first: Although this would work for Genshin and HSR, this will have no effect on HI3 as the file names are different (thanks, Hoyoverse), and thus has its own filter inside the class (not using the utils)

See HonkaiImpactGameCN.java:94

I would also argue that this is not compatible with the pre-download patching, but Hoyoverse broke it first.

Now, about the feature itself, my first idea on top of my head is:

  1. Create a static in each game class (CN side) which will store the default Predicate<File> filter, with the same default as right now for each game
  2. Update the code to use the static instead of hardcoded filter stream (both for extraction and patching)
  3. When -a or --all is provided, update the filters from the application class code.

Maybe also adding a small log line when the flag is provided ? Although it is pretty clear that it will some time and consequent size when the flag is provided, I'm pretty sure some people will quite surprised about it.

alexpado commented 4 months ago

If you haven't started working on it, I had another idea. Using Regexes might be more appropriate, as on top of providing --all flag, a --filter= flag could be added, where the user can use their own filter rules by providing a regex.

--all would set the --filter value to .* (extracting all pck files, keeping the pck filtering outside the regex)

avetharun commented 4 months ago

I have but the idea I was working with until now is filtering out with string matches (ie "Minimum,Music". Regex would be much better

I'll try using that instead later

On Fri, Jun 21, 2024, 5:39 AM Alexandre PADOVAN @.***> wrote:

If you haven't started working on it, I had another idea. Using Regexes might be more appropriate, as on top of providing --all flag, a --filter= flag could be added, where the user can use their own filter rules by providing a regex.

— Reply to this email directly, view it on GitHub https://github.com/alexpado/hoyoverse-music-unpacker/pull/19#issuecomment-2182676695, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATFET7CDN36X4JBHBYFJBNTZIQNIFAVCNFSM6AAAAABJROCKN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBSGY3TMNRZGU . You are receiving this because you authored the thread.Message ID: @.***>

avetharun commented 3 months ago

Fixed comment issue