summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-04-12 13:25:42 +0000
committerworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-04-12 13:25:42 +0000
commit19c178562b1008ad84f11f8c059f66bc798bb361 (patch)
treedf67ab406594ed75ea90fcf905adb43f92b3dbcd
parent57d7ee812c8be1bd118471512682cb3393ce595f (diff)
downloadvdr-plugin-muggle-19c178562b1008ad84f11f8c059f66bc798bb361.tar.gz
vdr-plugin-muggle-19c178562b1008ad84f11f8c059f66bc798bb361.tar.bz2
if lyrics are loaded from internet and no local lyrics exist yet, the are now
saved automatically git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@1175 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r--HISTORY6
-rw-r--r--lyrics.c27
2 files changed, 22 insertions, 11 deletions
diff --git a/HISTORY b/HISTORY
index 33ef516..0c84e89 100644
--- a/HISTORY
+++ b/HISTORY
@@ -324,4 +324,8 @@ XXXXXXXXXX: Version 0.0.8-ALPHA
Cached files are permanently cached. If the last modification of the original image
indicates a change, the cached file is regenerated.
- import: for flac files, prefer vorbis comments over id3 tags as recommended
- by the flac people \ No newline at end of file
+ by the flac people
+
+2008-x-x Version 0.2.1-BETA
+- if lyrics are loaded from internet and no local lyrics exist yet, the are now
+ saved automatically
diff --git a/lyrics.c b/lyrics.c
index 0cb8e6d..a5c3c59 100644
--- a/lyrics.c
+++ b/lyrics.c
@@ -64,19 +64,26 @@ mgLyrics::Process(eKeys key) {
if (!access(playItem->getCachedFilename("lyrics.tmp.loading").c_str(),R_OK)) {
state=lyricsLoading;
playItem->setCheckedForTmpLyrics(time(0));
- } else if (!access(playItem->getCachedFilename("lyrics.tmp").c_str(),R_OK)) {
- state=lyricsLoaded;
- playItem->setCheckedForTmpLyrics(0);
- } else if (displayItem!=playItem) {
- if (!access(playItem->getCachedFilename("lyrics").c_str(),R_OK)) {
- state=lyricsSaved;
+ } else {
+ bool normfound=!access(playItem->getCachedFilename("lyrics").c_str(),R_OK);
+ if (!access(playItem->getCachedFilename("lyrics.tmp").c_str(),R_OK)) {
playItem->setCheckedForTmpLyrics(0);
+ state=lyricsLoaded;
+ if (!normfound) {
+ SaveExternal();
+ state=lyricsSaved;
+ }
+ } else if (displayItem!=playItem) {
+ if (normfound) {
+ state=lyricsSaved;
+ playItem->setCheckedForTmpLyrics(0);
+ } else {
+ LoadExternal();
+ }
} else {
- LoadExternal();
+ state=lyricsSaved;
+ playItem->setCheckedForTmpLyrics(0);
}
- } else {
- state=lyricsSaved;
- playItem->setCheckedForTmpLyrics(0);
}
}
if (displayItem!=playItem || state!=prevstate) {