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

ZIP-archive and directory sorting is broken. #950

Open
TpaBkaY opened this issue Jan 13, 2025 · 10 comments
Open

ZIP-archive and directory sorting is broken. #950

TpaBkaY opened this issue Jan 13, 2025 · 10 comments

Comments

@TpaBkaY
Copy link
Contributor

TpaBkaY commented Jan 13, 2025

@okdana What is the main idea to roll back these changes? What problem does it fix?

Originally posted by @TpaBkaY in 1017633

@okdana
Copy link
Contributor

okdana commented Jan 13, 2025

hi @TpaBkaY. like i mentioned in #943, the mister menu treats zip archives almost exactly like directories for the purposes of navigation, so it kind of pressures you to do the same. which i have been for the last 5 years

the particular use case i have that the previous change broke is a file structure like this:

1 rarely updated files.zip
2 frequently updated files/
3 rarely updated files.zip
1 regular file.bin

with the previous change it became:

2 frequently updated files/
1 rarely updated files.zip
3 rarely updated files.zip
1 regular file.bin

which seems like 'the worst of both worlds' to me

besides breaking my particular habits it just doesn't seem useful -- what benefit does sorting zip files separately from other files and directories provide? it's not a file manager, the only thing you can do is navigate, and again zips are exactly the same as directories for that purpose. so why distinguish them? is there another use case i don't understand?

i mentioned in #943 that i would personally prefer that zips get treated just like any other file, and that they automatically select a file inside if it's the only one there. this is similar to how many software emulators behave. if there was an ini setting to toggle between that and the current behaviour (and maybe the one from your previous change? if it's actually a common use case?) i think that could make everyone happy. but i had the feeling that sorgelig prefers not to add lots of ini settings so i made the less drastic change

@sorgelig
Copy link
Member

It's a bad behavior to give the same name for directory and zip. If you are aware that zip is shown as a directory then give a little different name.

@okdana
Copy link
Contributor

okdana commented Jan 15, 2025

not sure if you're referring to me, but if so i haven't done that

@birdybro
Copy link
Member

birdybro commented Jan 15, 2025

Here's an alternative example. Here is how it functioned before @okdana's changes

Favorites\
Europe.zip
Japan.zip
USA.zip

This is the way it is sorted on most operating systems.

However, @okdana's change makes it so the sorting would look like this instead:

Europe.zip
Favorites\
Japan.zip
USA.zip

In this use case @okdana likes to add roms to the favorites folder, but the roms in the zip files are static and don't need to be changed. @okdana wants to make this the sorting preference because MiSTer's UX already treats zip files as folders/directories in how the user interacts with them.

@sorgelig
Copy link
Member

This is the way it is sorted on most operating systems.

on operating systems zips are shown as files, not as folders.
I'm not 100% sure what sorting is better. Basically, if zips are shown as folders then it's better if it sorted with folders together.

@birdybro
Copy link
Member

on operating systems zips are shown as files, not as folders.

Yes, that's what I meant.

@TpaBkaY
Copy link
Contributor Author

TpaBkaY commented Jan 27, 2025

As @birdybro said above, showing directories at the beginning of the files list is an established principle. I see no reason why we shouldn't use the same thing in MiSTer. I suggest to roll back #943 commit.

@okdana
Copy link
Contributor

okdana commented Jan 27, 2025

As @birdybro said above, showing directories at the beginning of the files list is an established principle. I see no reason why we shouldn't use the same thing in MiSTer

separating zip files out from all other file types and sorting them in between directories and files is not an established principle, however. i'm not aware of any operating system or application that has ever done that, and you haven't provided a justification for it despite repeated requests

i want to emphasise that the second sorting example (zips with directories) in @birdybro's comment was not something i invented. #943 restored the previous sorting behaviour that mister already had. it was like that since zip support was added 7 years ago (#43), until #900 changed it

@TpaBkaY
Copy link
Contributor Author

TpaBkaY commented Jan 27, 2025

I'm not saying that a ZIP file is a any special file. I'm saying that a directory is not a ZIP file! We usually use directories to group some files by some common feature.

@okdana asked for examples. Here is the main MiSTer repository: https://github.com/MiSTer-devel/Main_MiSTer . Here is the Apache server output for files:: https://mirrors.kernel.org/gnu/ . You can see everywhere that directories are always at the beginning ot the list.

Here is an example of how this relates to MiSTer. A typical ROMs collection looks like this (for example for SNES):

Favorites\
Hacks\
Homebrew & Unlicensed\
Japan\
PAL to NTSC\
Translations\
Unreleased\
7th Saga, The.zip
A.S.P. - Air Strike Patrol.zip
ActRaiser.zip

... and other 500 and more ZIP files

Zombies Ate My Neighbors.zip
Zool - Ninja of the ''Nth'' Dimension.zip

If we start mixing catalogs with ZIP files, then to find Hacks ROMs for example, you have to flip through a lot of pages with ZIP files...

I will repeat the main idea of ​​this message, usually we put in catalogs what we want to get quick access to (Favorites, Hacks, etc.).

To say that it has been like this for 7 years so let's leave it like this, looks a bit strange. It's just that people have learned to live with this in MiSTer over these 7 years and started using different tricks:

001_Favorites\
001_Hacks\
001_Homebrew & Unlicensed\
001_Japan\
...
other ZIP files

Only because we can't sort files properly.

@okdana
Copy link
Contributor

okdana commented Jan 27, 2025

A typical ROMs collection looks like this

not sure about the specifics of that but yes, i would have also preferred originally to be able to keep roms individually zipped that way. but because mister otherwise treats zips like directories, the experience is annoying (basically having to select the file twice), and the advice of some reddit posts, youtube videos, etc. is to not store them individually zipped for that reason, but instead to re-compress them into bundles like Europe.zip Japan.zip USA.zip as in @birdybro's examples

since afaik it's not feasible for mister itself to determine ahead of time whether the user's file structure uses zips for bundles or individual files, the only options are to either unilaterally pick a behaviour or add an ini setting to control it. possibly the original behaviour was not the best one, but it is the one that some people like me apparently have tailored their file structures to since it was already like that, so i think regardless of anything else that's a strong point in its favour. i think an ini setting would be nice though, if sorgelig isn't opposed to it

in any case, if we did want zip files to be treated like other files, i think #900 goes about it in an extremely strange way. it sorts them before other files and it adds an indicator to the right side -- again, like a directory. it feels almost contradictory to the goal

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

No branches or pull requests

4 participants