2 posts tagged “how to”
Overnight Flickr launched their video support, which I'm sure you can read about everywhere else. I'd like to note (as much for myself as anything) how to handle videos in the API.
As with the main site, videos are treated just as funny photos. As kellan explained on the Flickr API group, the API does just the same thing. There's a new "extras" parameter, "media", which returns either "photo" or "video". What isn't fully explained on the thread is how to display a video as a video, rather than as a static thumbnail (the way Flickr themselves do on, for example, pool pages).
The answer is to use the embedding code shown with each video. (You'll need to be logged in to see that page.) Seasoned API users will note that the photo ID and secret are in the code that Flickr gives you, so it looks like it'll be easy to check the media attribute for a photo, and either show just the image, or use the Flash code (with the appropriate substitiutions) to show a playable version. Unfortunately, if you can't figure out the aspect ratio of the image (typically by using the o_dims extra argument to methods like flickr.photos.search - and yes, it works for videos), you'll need to do an extra call (to flickr.photos.getSizes) to get those arguments for the <object> tag. (This is a problem for images, too, but I'd be happier leaving height and width tags out of an <img> than an <object> tag.)
In summary, then, supporting videos on Flickr through the API looks as if it should be straightforward, and in fact even if you do nothing then it'll work (albeit with videos treated as images). Nicely done.
One of the key new features in iTunes 7.1, which came out earlier this week, is "enhanced sort options". What does that mean? Why would you want such a thing? How do you use them? I'm here to answer all of these questions. Hopefully.
Before iTunes 7.1
Since at least iTunes 5, there's been automatic discarding of stopwords (for example, "the" and "a") at the beginning of group and album names. This means that The Beatles are found under B, not T. However, John Lennon still appears under J, because iTunes didn't do automatic name reversal.
(Of course, there are good technical reasons for this. Take "The Beatles", "Tori Amos" and "Carter USM" and tell me what order they come in. Naively you'd have "Carter USM, The Beatles, Tori Amos", and iTunes manages "The Beatles, Carter USM, Tori Amos", but a record store would be able to use human ingeniuity to list them as "Tori Amos, The Beatles, Carter USM". If you can codify rules for distinguishing Carter USM and Tori Amos, though, I'll be amazed.)
Some people modified their MP3s to have tags that put the names the other way around, just for sorting, but most of us just dealt with it as best we could and remembered to hit T for Tori Amos, even if we'd rather have looked in A.
One slightly odd implementation detail of this feature was that users whose iTunes interface was in languages other than English had their own list of stopwords, so for German users The Beatles were indeed sorted to T. Sven-S. Porst provided a small patch to correct this, but there was no official way to fix it, any more than there was a way to make John Lennon nestle amongst the Ls.
Apple obviously started caring about this, because iTunes 7 introduced a new sorting option, although it's far from obvious where to find it. If you click on any field heading in the main iTunes track list, the library is sorted by the desired field. However, if you click on
Album repeatedly, you get "Album by Artist", which sorts by artist first, then
by album, then "Album by Year", which is similar except the year of the album is taken into account (so you can
play through a band's career in chronological order.)
One consequence of this change is that to modify the sort ordering (from A-Z to Z-A, or chronological to reverse chronological), you now have to click on the arrow. Previously, you could use any part of the header, but the introduction of the sorting options discussed above made that impractical.
New in iTunes 7.1
iTunes 7.1 sees an overhaul of sorting. The easiest way to see this in action is to go to View > View Options (also available by using Command J) where you'll see a series of fields prefixed "Sort". Enable one (I suggest Sort Artist) and it will appear in the main library window, but you'll notice the contents are grey. Despite this, the contents are editable. Even if you've never used the feature before, you'll see a few fields filled in; these are the previously-implicit sort options discussed above. You can sort by the Sort Artist field, although this is a bit silly, as it's exactly the same as sorting by the Artist field- after all, that's the point. I imagine you'll want to switch the field off again, though, as it takes up a lot of space without telling you anything useful.
If, as I suggest, you don't use a column to show the sort ordering, how can you edit it? The easiest way to do so is to select a single track and open the Get Info window (command I). There's a new panel in this window, halfway along, called Sort Options. In this window you can customise the details of not only the album and artist name, but also the song name, and other fields. So if you want to move John Lennon from J to L, put "Lennon, John" in the Sort Artist track.
Astute readers will have realised this only applies to the track they've selected, and possibly leapt ahead and tried selecting multiple tracks and opening Get Info once more. Here we hit a snag- this dialog doesn't show any sort fields. How, then, do you fix up all those tracks? It's far from obvious, but there's a menu option: Advanced > Apply Sort Field (also available in the context menu). Select a track for which you've already mofidied a sort field, then select this option, and you'll see one of the least clear dialog boxes I've seen recently.
What it's really asking is "Do you want to change the sort artist of all tracks by 'John Lennon' to 'Lennon, John'?". You probably want to both say Yes to this, and to check the "Don't ask me again" box for good measure.
Custom sort data is written to MP3 files; for example, the Sort Artist is in the ID3v2.3 field TSOP. However, the initial (implicit) sort data (such as "The Beatles", mentioned earlier) isn't encoded into tags. (Thanks to Sven-S. Porst for the correction.)
As a final side note, I'll mention that the new "Album by Artist/Year" option noted above didn't work over iTunes Library Sharing in versions of iTunes, until the release of 7.1, so it's nice that that's fixed.
In conclusion: is it any good?
Sort field customisation is a really powerful feature, but Apple's implementaton is pretty annoying. I'd rather not have had the option to view sort fields in the library, and instead get a more sensible way of applying sort fields to multiple tracks, either by a second pane in the multiple track Get Info window, or an automatic "You've changed John Lennon; do you want to apply this to all John Lennon tracks?" dialog.
Apple's documentation of this feature is also nearly non-existent. There's a single page in the Help Book for iTunes on sorting, and while it says "For example, you could set up iTunes to sort songs by an artist's last name instead of the first", it gives you no idea on how to manage this. Let's face it, people don't write blog entries like this for obvious features.
On the other hand, as far as I know, no other major music library manager application has attempted to solve this problem before, and the underlying infrastructure is fairly sound. I just hope that there's a chance to apply a little UI polish in the future.
(Thanks to Tom Insam for poking at a copy of iTunes while I was at work and Sven-S. Porst for his post on iTunes 7.1 which prompted me to make more of a how to guide.)