-
Notifications
You must be signed in to change notification settings - Fork 5
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
Coalescing filenames intended behavior #124
Comments
Priority is per-(direct subclass of)FileLoaderBase -- i.e., each concrete subclass of, say, SoundFileLoader must have a unique priority. See #124 for more context :^)
...
This sounds exactly right. And imo the priority ranking should be something like
I could see people having their files organised like that. Maybe something like
Perhaps we could find a way to support this structure. In this case,
Yes, name of the link. Something I often do is symlink a bunch of non-correspondingly named things into a single directory or set of directories. |
This is all implemented in #125.
Currently, the
I agree that this would make sense to support, although I think it's fairly difficult to automatically guess. For example, we would also theoretically want to support
To me, this feels like a problem we should solve later.
👍 |
Assigning integer priorities at register time seems a bit cumbersome and error prone. If you want to add a new file loader, you need to make O(# loaders) changes in the worst case. What if we have a file which specifies the priorities as a list For the same name different path case, I think it would make sense to prompt the user to make a choice in the UI since it's not obvious to me what a good default is. |
I think there's probably a way to do this automatically. |
How would you handle user-defined loaders then? By just always giving them the highest priority and preventing them from registering conflicting loaders? |
This issue has been discussed. Anything further that's related can be brought up in new issues. |
Currently, we attempt to associate / coalesce files by their filename. In the normal case, that means we will see a directory such as
and determine that there is a
file00
container with three associated files, which we will use to populate our widgets. Note: in the1.0
architecture, this is basically equivalent toMetadata::getFileLevel
, and in the2.0
architecture, this is handled inFileBundleList::build_from_dir
.For the majority of cases, this simple "extract filename and grab anything with relevant extensions" approach works fine, but I think we have undefined behavior in at least the following cases. I'm hoping y'all have some ideas about how we should handle them.
There's some more related discussion here, here, and here.
1. Same name, different extension
It doesn't make any sense to have both
mp3
andwav
"versions" of a file loaded -- which would play through our interface?I think the sensible thing in this case is to have some sort of priority assigned to each loader of a specific subtype. At
register
-time, we could enforce that there are no "ties" in priority. Then, we could justor something to that effect. In this case, we should probably still emit warnings that we're "ignoring" a potentially valid file.
2. Same name, same extension, different path
This may be a pathological example that we just don't want to support. Coalescing on only filename (and ignoring the full path) allows us to support arbitrarily nested directories. If we change this behavior to tracking (some subset of) the path, we lose that benefit and our whole model goes out the window.
Sensible behavior here might be to enforce deterministic behavior using sorting, and then just keep the first (or last?) match, again emitting a warning to the user.
3. Symlinks
Do we want to use the name of the link or the name of the target? To me, I think using the link name makes more sense, since we may not have write permissions on the target (and thus not be able to change its name).
I'm going to submit a PR that defines some of this behavior shortly, but I figured this would be a good place for any discussion.
The text was updated successfully, but these errors were encountered: