📜 ⬆️ ⬇️

MeloManiac - album database for music lovers

At the beginning of this year, I started developing a workflow system for one company, and under the conditions I had to work with the Turbogears framework, a Python system for creating client-server applications that work through a browser. To make it more interesting to deal with a new thing for myself, I simultaneously began to write for myself a system for the classification of music albums. The fact is that existing similar databases that exist on the Internet did not suit me: Last.fm does not allow evaluating albums, navigation is uncomfortable everywhere, and most importantly, there is no reference to its collection. Offline programs like iTunes also do not suit me, again because of a different initial focus: they are sharpened more for listening than classification and sorting by the necessary criteria, in addition, it was necessary to add albums that are not on the computer, but in the form of physical disks.

Why am I writing all this here. It is interesting to see how relevant this matter is now, someone needs it. Or maybe some companies are interested in such developments - then I will be happy with offers of cooperation (dimouse _at_ old-games.ru).

And a few more comments before going to the point. Initially, for the presentation of the program, I wanted to record a video, but due to mature reflection, I came to the conclusion that this is unnecessary and you can do with a few slides in the form of gifs. Hope this is perfectly acceptable.
')


image

I didn’t bother with the interface: there are three main pages with access to the tables, respectively, of artists, albums and genres. On each, by itself, the main CRUD functionality is implemented, there is the possibility of sorting and filtering tables. All this is very easy to organize thanks to the MVC paradigm that guided the creators of Turbogears, as well as the use of SQL Alchemy.

image

On the page with the performers I would like to mark the artist's rating, which is calculated by the following formula: the average rating for albums (except those that are not rated) + the number of such albums / 10. Thus, the titans, who made several dozen excellent albums, will be more or less balanced. , but somewhat spoiled the impression with a small number of middling or failed albums (and such happen to everyone except Mercyful Fate :)), and groups that shot brightly with a single album, but then did nothing. The result of such a rating seemed to me very close to my real preferences, so I use it.

image

The main page is, of course, albums. As it was stated at the beginning, besides the information about the album itself, I keep here information about its availability. The fact is that the base began to come together as a text file for me even a few years ago, and many of the albums that were once inevitably lost, especially for mp3 files, so the system can also be useful because can show such albums - they need to find and download. The “rips I don't have” link on the main page is just a shortcut for displaying such albums. In addition, I also keep information about the availability of albums in my physical form here - and a separate bit here is allocated for albums released abroad (unfortunately, the main part of my discs so far is the legacy of the 90s pirated past). I also wanted to add a bit for the presence of an album in the form of a plate, but I haven’t started yet - I have few records, although if some music lovers want to use it, then they may need such functionality.

Each change to an album entry is recorded as a “last modified date”. In fact, it was necessary to make a separate variable for recording the exact date of listening, but so far it has been done so, therefore, sorting and filtering by date show everything on the heap: those albums that have been listened to and rated, those that have changed data, as well as new ones that have been recently added ( they, however, can be separated from the estimated ones, as they, as a rule, still have no assessment).

Filling the database manually is certainly fun, but it would be strange not to use automated tools to add data directly from a computer: for today, music collections are primarily MP3. And in MP3 files there are tags with which amateurs always have a headache on everything: well, people don’t like to fill them in correctly, and generally fill them out. Not to mention the file names ... Therefore, the system Melomaniac on the one hand, checks the correspondence of the database and files, and on the other, it can “populate” all at once from there (though, you will first need to get the right performers), which will be very convenient who is just starting his album list, and not like me - fine-tunes an already existing list for the system written for her with the help of a chain of complex conversions (at first I didn’t decide what it would be like, I wrote the C system using CppSQLite3.

image

Yes, a few words about the technical implementation. In order to organize all this, we need to somehow work with MP3 tags under Python. There are a lot of similar libraries that are riveted, so there is no point in doing something for yourself. Mutagen was taken, as the most convenient and developed. In Mutagen, among other things, there is a script for converting all tags to Unicode, but under Windu you don’t work with it, so the code was adapted and included in Melomaniac. Now, finally, all the tracks are displayed normally when I want to listen to music from the TV! The output of information about tracks in this directory is rather informational, as there is no information about the tracks themselves in the database, although, to be honest, sometimes it pulls to do this and see which album is the longest in my collection, where most of the songs and t .d

In general, there is a huge field for development: you can also talk about different releases of one album, linking these releases to specific directories on a computer (or on a network drive, like mine), checking the availability of necessary tracks in these directories by the system, as well as tracking the nesting structure of these directories and their names (for example, GENR / EXECUTOR / ALBUM / RELEASE), but at the moment I do not want to overload the system with little-used pieces: I can watch the listened albums and those that have yet to listen, look at with ou assess, compare, have access to the http-server software on any of your computers (inside the home grid) - and more to me, in general, and is not necessary.

I would be happy to hear feedback or people interested in using the program.

Source: https://habr.com/ru/post/186222/


All Articles