library: Don't attach artist_id to albums
This was an unnecessary field, and might potentally result in album duplication. Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
This commit is contained in:
parent
2960b72967
commit
1e09406730
|
@ -44,7 +44,6 @@ namespace library
|
|||
std :: string name;
|
||||
std :: string name_lower;
|
||||
unsigned int year;
|
||||
unsigned int artist_id;
|
||||
|
||||
Album();
|
||||
Album(TagLib :: Tag *, unsigned int);
|
||||
|
|
|
@ -83,19 +83,19 @@ void library :: AGInfo :: write(File &f)
|
|||
*/
|
||||
|
||||
library :: Album :: Album()
|
||||
: name(""), year(0), artist_id(0)
|
||||
: name(""), year(0)
|
||||
{
|
||||
}
|
||||
|
||||
library :: Album :: Album(TagLib :: Tag *tag, unsigned int artist)
|
||||
: name(tag->album().stripWhiteSpace().to8Bit(true)),
|
||||
year(tag->year()), artist_id(artist)
|
||||
year(tag->year())
|
||||
{
|
||||
name_lower = filter :: lowercase(name);
|
||||
}
|
||||
|
||||
library :: Album :: Album(const std::string &str, unsigned int yr, unsigned int artist)
|
||||
: name(str), year(yr), artist_id(artist)
|
||||
: name(str), year(yr)
|
||||
{
|
||||
name_lower = filter :: lowercase(name);
|
||||
}
|
||||
|
@ -103,20 +103,20 @@ library :: Album :: Album(const std::string &str, unsigned int yr, unsigned int
|
|||
const std::string library :: Album :: primary_key()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << artist_id << "." << name << "." << year;
|
||||
ss << name << "." << year;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void library :: Album :: read(File &f)
|
||||
{
|
||||
f >> artist_id >> year;
|
||||
f >> year;
|
||||
name = f.getline();
|
||||
name_lower = filter :: lowercase(name);
|
||||
}
|
||||
|
||||
void library :: Album :: write(File &f)
|
||||
{
|
||||
f << artist_id << " " << year << " " << name;
|
||||
f << year << " " << name;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue