From: Felix Domke Date: Tue, 31 Oct 2006 21:03:52 +0000 (+0000) Subject: refuse to write metadata when no real metadata is available X-Git-Tag: 2.6.0~2798 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/4d422235e5ec6b8464eef7c0763af7f63e7d1c57 refuse to write metadata when no real metadata is available --- diff --git a/lib/dvb/metaparser.cpp b/lib/dvb/metaparser.cpp index ed4947b4..3e3f9a79 100644 --- a/lib/dvb/metaparser.cpp +++ b/lib/dvb/metaparser.cpp @@ -5,6 +5,7 @@ eDVBMetaParser::eDVBMetaParser() { m_time_create = 0; + m_data_ok = 0; } int eDVBMetaParser::parseFile(const std::string &basename) @@ -64,6 +65,7 @@ int eDVBMetaParser::parseMeta(const std::string &tsname) ++linecnt; } fclose(f); + m_data_ok = 1; return 0; } @@ -111,6 +113,8 @@ int eDVBMetaParser::parseRecordings(const std::string &filename) m_name = description; m_description = ""; m_time_create = 0; + + m_data_ok = 1; fclose(f); return 0; } @@ -121,6 +125,8 @@ int eDVBMetaParser::parseRecordings(const std::string &filename) int eDVBMetaParser::updateMeta(const std::string &tsname) { + if (!m_data_ok) + return -1; std::string filename = tsname + ".meta"; FILE *f = fopen(filename.c_str(), "w"); diff --git a/lib/dvb/metaparser.h b/lib/dvb/metaparser.h index 5eddaa09..01fabde8 100644 --- a/lib/dvb/metaparser.h +++ b/lib/dvb/metaparser.h @@ -14,6 +14,8 @@ public: int parseRecordings(const std::string &filename); int updateMeta(const std::string &basename); + int m_data_ok; + eServiceReferenceDVB m_ref; std::string m_name, m_description; int m_time_create;