eDVBMetaParser::eDVBMetaParser()
{
m_time_create = 0;
+ m_data_ok = 0;
}
int eDVBMetaParser::parseFile(const std::string &basename)
case 3:
m_time_create = atoi(line);
break;
+ case 4:
+ m_tags = line;
+ break;
default:
break;
}
++linecnt;
}
fclose(f);
+ m_data_ok = 1;
return 0;
}
FILE *f = fopen(recordings.c_str(), "r");
if (!f)
{
- eDebug("no recordings.epl found: %s: %m", recordings.c_str());
+// eDebug("no recordings.epl found: %s: %m", recordings.c_str());
return -1;
}
std::string description;
eServiceReferenceDVB ref;
- eDebug("parsing recordings.epl..");
+// eDebug("parsing recordings.epl..");
while (1)
{
if ((line[0] == '/') && (ref.path == filename))
{
- eDebug("hit!");
+// eDebug("hit! ref %s descr %s", m_ref.toString().c_str(), m_name.c_str());
m_ref = ref;
m_name = description;
m_description = "";
m_time_create = 0;
+
+ m_data_ok = 1;
+ fclose(f);
return 0;
}
}
fclose(f);
return -1;
}
+
+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");
+ if (!f)
+ return -ENOENT;
+ fprintf(f, "%s\n%s\n%s\n%d\n%s\n", m_ref.toString().c_str(), m_name.c_str(), m_description.c_str(), m_time_create, m_tags.c_str());
+ fclose(f);
+ return 0;
+}