exp, your description pretty much covery everything I said earlier, except that there's no need for a special folder filetype. You can get by with adding only a single new field: the parent's file id. If you read the files from the DB into a hash keyed by fid and another hash keyed by parent, you can do the group assignments in memory with only a single query to get all files that belong to the episode to display: Containers are files without a size, subfiles are files with a parent that is in the same episode and symlinks are files with a parent that is not in the same episode. Since these conditions ("(not) in the same episode") would require too many queries with obfuscated joins, i would think that checking for these in Perl saves a lot of precious CPU time.
Also, the creation of symlinks can theoretically be left to the users: After all, they are just additional entries in the files table with their parent field set to a meaningful value.
You can leave that to the users, too. Since groups are really only files without a size of their own, the group/container/folder itself can have a watched flag. Naturally, this flag would override the contained files' flags. In other words: Just ignore the files' watched status and let users mark the container as watched/unwatched. Afterall, that's the most logic thing to do since watching one of the files in a group/container/folder is equal to watching a fraction of an episode...exp wrote:concerning the mylist/watched status there is a problem though, does a folder only count as (watched) file in mylist if all of it's subfiles are part of the mylist (and watched)? Or is one file sufficient? Or do we _need_ (read do we die without) a way to mark files of a folder as required/optional?
Thanks.exp wrote:*note to self, there's a whole bunch of new ppl to hate now*