Ready for release

This commit is contained in:
kdeng00
2022-01-09 18:06:43 -05:00
parent c8e8c1a460
commit d9962749c8
5 changed files with 80 additions and 25 deletions
+44 -2
View File
@@ -1,8 +1,9 @@
#ifndef SONG_H_
#define SONG_H_
#include<string>
#include<iostream>
#include <string>
#include <iostream>
#include <sstream>
namespace Models
@@ -19,6 +20,44 @@ public:
std::cout<<"\n";
}
std::string song_path() noexcept
{
std::stringstream buffer;
buffer << this->directory;
const auto count = this->directory.size();
if (this->directory.at(count - 1) != '/' || this->directory.at(count - 1) != '\\')
{
buffer << "/";
}
buffer << this->filename;
return buffer.str();
}
int generate_filename_from_track()
{
auto result = 0;
std::stringstream buffer;
buffer << "track";
// NOTE: Multiple discs in one directory is not being addressed
if (this->track < 10)
{
buffer << "0";
}
buffer << this->track << ".mp3";
this->filename.assign(buffer.str());
return result;
}
std::string toMetadataJson();
@@ -32,7 +71,10 @@ public:
int track;
int disc;
std::string data;
[[deprecated("Use song_path() function instead")]]
std::string songPath;
std::string filename;
std::string directory;
};
class CoverArt