From 91c359fdb2a425f84972aeb090372471ddb79365 Mon Sep 17 00:00:00 2001 From: woro Date: Sun, 13 Apr 2008 16:20:52 +0000 Subject: if we got lyrics from the net but did not save it, the temporary file .lyrics.tmp will be deleted when the next track starts playing (only while in lyrics mode, if you leave it, the tmp file remains) git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@1183 e10066b5-e1e2-0310-b819-94efdf66514b --- HISTORY | 3 +++ lyrics.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index fc21453..c588112 100644 --- a/HISTORY +++ b/HISTORY @@ -336,3 +336,6 @@ XXXXXXXXXX: Version 0.0.8-ALPHA match the database, it could happen that we never get anything displayed until we delete muggle.state and restart muggle. Now muggle goes up to the parent level - reintroduced Finnish translation +- if we got lyrics from the net but did not save it, the temporary file .lyrics.tmp + will be deleted when the next track starts playing (only while in lyrics mode, + if you leave it, the tmp file remains) \ No newline at end of file diff --git a/lyrics.c b/lyrics.c index a5c3c59..c8602a5 100644 --- a/lyrics.c +++ b/lyrics.c @@ -58,8 +58,14 @@ mgLyrics::SaveExternal() { eOSState mgLyrics::Process(eKeys key) { playItem=mutPlayingItem(); - long cl=playItem->getCheckedForTmpLyrics(); LyricsState prevstate=state; + if (displayItem!=playItem && prevstate==lyricsLoaded) { + char *cmd; + msprintf(&cmd,"rm -f %s",displayItem->getCachedFilename("lyrics.tmp").c_str()); + SystemExec(cmd,true); // run detached + free(cmd); + } + long cl=playItem->getCheckedForTmpLyrics(); if (displayItem!=playItem || cl>0 && clgetCachedFilename("lyrics.tmp.loading").c_str(),R_OK)) { state=lyricsLoading; -- cgit v1.2.3