User:Feldmahler/New Indexing and Imaging System
During the administering of IMSLP, I've realized that it is a much better idea to use server-side programs to do formatting work than to ask the contributors to do so. This not only lightens the load on the contributors, but also keeps the IMSLP file naming/indexing system consistant.
I'm writing this here just so that I won't forget (since I'm not going to do this anytime soon).
To create an indexing/imaging system where file names can be easily and automatically renamed to fit the index system; file names are considered completely dynamic.
Canonical image filename:
Composerlastname - Workpagename (filedescription) [#imslpindex].ext
Fields in Index table
- IMSLP Index Number (key)
- Image ID Number
Fields in Description table
- IMSLP Index Number (key 1)
- Page ID of page the entry is on (key 2)
- File description
Difference from current setup
- File description will not be on the wiki page; instead, it will be in the description table, and will be shown via a parser hook. There will be a special page for changing a file description.
- Files will be identified on work pages via Image ID number (to prevent mistaken modification if the actual IMSLP index number is used).
- Multiple entries will be allowed in the description table. The entry that ultimately becomes the file name can be decided one of two ways:
- Use the first description entry that is actively in use (i.e. image linked to on page).
- Dynamically generate filename depending on which work page the file is downloaded from. This will have to depend on what mechanisms the new file storage system uses (will work best with a PHP downloader, but that is expensive).
- Dealing with renaming of work page
- Possible solution #1: Use the work page name instead of Page ID in the Index table, thereby liberating the image filename from the work page name.
- Possible solution #2: Write a hook that hooks to the page moving function, and which will rename all the files on the page when a page is moved. Of course, just using the new page title in future file downloads is fine, but whether that is possible will depend on the file storage system download mechanisms.
- Backwords compatibility with current scheme
- Possible solution #1: Write a reverse lookup function which looks up the Image ID from the image name, thereby permitting the use of the old indexing function.
- Treatment of files on the US server
- Possible solution #1: Upload a stub (placeholder) image for every file on the US server.
I would like to wait for the upstream (Mediawiki) work on the new file storage system to finish before implementing this. Apparently, a file renaming function is planned for this, and I'd like to avoid having to write one myself for the current storage system.
The Mediawiki roadmap gives the version in which this feature will debut as 1.10, but that may be unlikely, since 1.10 is going to be released very soon. However, this feature is on high priority, so it should be finished relatively soon, even if not by 1.10's release date.