I am parsing a sqlite database of songs to find the favourites of each user (that's just a simple sqlite query)
It returns an object like
{"artist": "Children of Bodom", "album": "Something Wild", "track": "In the Shadows", "path":"/media/data/Music/Children of Bodom/Something Wild/02 In The Shadows.flac"}
Which I am parsing into a tree-like structure. Unfortunately, python only has dicts, which can be nested to be kind-of like trees.
Basically, the logic is as follows:
if artist not in library:
library[artist] = {album: set(artist, album, track, path)}
else
if album not in artist:
library[artist][album] = set(artist, album, track, path)
else
library[artist][album].add(artist, album, track, path)
So if an artist doesn't exist, the artist, album and track are all added (since they can't possibly exist yet)
If an artist exists, but the album doesn't, then the album is added, together with the current track
If the artist and the album exist, then the track is added
or put on ebay an item to sell for a couple million dollars, and put the vuln on the Product Details... the product itself is the Product details printed
a product for 10 million will surely be viewed by a lot of people even if for curiosity only