12 changes: 3 additions & 9 deletions mythplugins/mythmusic/mythmusic/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Metadata

bool isCDTrack(void) { return ID_TO_REPO(m_id) == RT_CD; }

QString Filename() const { return m_filename; }
QString Filename(bool find = true) const;
void setFilename(const QString &lfilename) { m_filename = lfilename; }

QString Format() const { return m_format; }
Expand Down Expand Up @@ -230,8 +230,6 @@ class Metadata

// static functions
static void setArtistAndTrackFormats();
static void SetStartdir(const QString &dir);
static QString GetStartdir() { return m_startdir; }
static QStringList fillFieldList(QString field);

// this looks for any image available - preferring a front cover if available
Expand Down Expand Up @@ -280,8 +278,6 @@ class Metadata
QString m_filename;
bool m_changed;

static QString m_startdir;

// Various formatting strings
static QString m_formatnormalfileartist;
static QString m_formatnormalfiletrack;
Expand Down Expand Up @@ -323,7 +319,7 @@ class AllMusic
{
public:

AllMusic(QString a_startdir);
AllMusic(void);
~AllMusic();

Metadata* getMetadata(int an_id);
Expand Down Expand Up @@ -363,8 +359,6 @@ class AllMusic
MetadataPtrList m_cdData; // More than one cd player?
QString m_cdTitle;

QString m_startdir;

MetadataLoadingThread *m_metadata_loader;
bool m_done_loading;
int m_last_listed;
Expand All @@ -390,7 +384,7 @@ class MusicData : public QObject
void reloadMusic(void);

public:
QString startdir;
QString musicDir;
PlaylistContainer *all_playlists;
AllMusic *all_music;
bool initialized;
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/musicplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ void MusicPlayer::customEvent(QEvent *event)
if (!startdir.endsWith("/"))
startdir += "/";

Metadata::SetStartdir(startdir);
gMusicData->musicDir = startdir;
}
}

Expand Down
7 changes: 2 additions & 5 deletions mythplugins/mythmusic/mythmusic/musicutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extern "C" {
}

// mythmusic
#include "metadata.h"
#include "musicutils.h"

static QRegExp badChars = QRegExp("(/|\\\\|:|\'|\"|\\?|\\|)");
Expand Down Expand Up @@ -46,13 +47,11 @@ QString findIcon(const QString &type, const QString &name)
return QString();
}

//TODO this needs updating to also use storage groups
uint calcTrackLength(const QString &musicFile)
{
LOG(VB_GENERAL, LOG_INFO, "**calcTrackLength - start");
const char *type = NULL;

// av_register_all();

AVFormatContext *inputFC = NULL;
AVInputFormat *fmt = NULL;

Expand Down Expand Up @@ -127,7 +126,5 @@ uint calcTrackLength(const QString &musicFile)
av_close_input_file(inputFC);
inputFC = NULL;

LOG(VB_GENERAL, LOG_INFO, "**calcTrackLength - end");

return duration;
}