130
130
g_free (cSongPath);
132
132
myData.cCoverPath = g_strdup_printf ("%s/%s - %s.jpg", cSongDir, myData.cArtist, myData.cAlbum);
133
cd_debug (" test de %s", myData.cCoverPath);
133
cd_debug ("MP - test de %s", myData.cCoverPath);
134
134
if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
136
136
g_free (myData.cCoverPath);
137
137
myData.cCoverPath = g_strdup_printf ("%s/cover.jpg", cSongDir);
138
cd_debug (" test de %s", myData.cCoverPath);
138
cd_debug ("MP - test de %s", myData.cCoverPath);
139
139
if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
141
141
g_free (myData.cCoverPath);
142
142
myData.cCoverPath = g_strdup_printf ("%s/Cover.jpg", cSongDir);
143
cd_debug (" test de %s", myData.cCoverPath);
143
cd_debug ("MP - test de %s", myData.cCoverPath);
144
144
if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
146
146
g_free (myData.cCoverPath);
147
147
myData.cCoverPath = g_strdup_printf ("%s/cover.jpeg", cSongDir);
148
cd_debug (" test de %s", myData.cCoverPath);
148
cd_debug ("MP - test de %s", myData.cCoverPath);
149
149
if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
151
151
g_free (myData.cCoverPath);
152
152
myData.cCoverPath = g_strdup_printf ("%s/album.jpg", cSongDir);
153
cd_debug (" test de %s", myData.cCoverPath);
153
cd_debug ("MP - test de %s", myData.cCoverPath);
154
154
if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
156
156
g_free (myData.cCoverPath);
157
157
myData.cCoverPath = g_strdup_printf ("%s/albumart.jpg", cSongDir);
158
cd_debug (" test de %s", myData.cCoverPath);
158
cd_debug ("MP - test de %s", myData.cCoverPath);
159
159
if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
161
161
g_free (myData.cCoverPath);
162
162
myData.cCoverPath = g_strdup_printf ("%s/folder.jpg", cSongDir);
163
cd_debug (" test de %s", myData.cCoverPath);
163
cd_debug ("MP - test de %s", myData.cCoverPath);
164
164
if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
166
166
g_free (myData.cCoverPath);
202
202
if (myData.cCoverPath == NULL || cairo_dock_strings_differ (myData.cPreviousCoverPath, myData.cCoverPath)) // la couverture a change, son existence est incertaine et il faudra charger la surface/texture avec une transition. Sinon son existence ne change pas et il n'y a rien a faire.
204
cd_debug (" c'est une nouvelle couverture (%s -> %s)\n", myData.cPreviousCoverPath, myData.cCoverPath);
204
cd_debug ("MP - c'est une nouvelle couverture (%s -> %s)\n", myData.cPreviousCoverPath, myData.cCoverPath);
205
205
myData.cover_exist = FALSE;
216
216
if (! g_file_test (myData.cCoverPath, G_FILE_TEST_EXISTS))
218
218
gchar *cCommand = g_strdup_printf ("wget \"%s\" -O \"%s\" -t 2 -T 30 > /dev/null 2>&1", cURL, myData.cCoverPath);
219
cd_debug ("%s\n",cCommand);
219
cd_debug ("MP - %s\n",cCommand);
220
220
cairo_dock_launch_command (cCommand);
221
221
g_free (cCommand);
222
222
g_free (myData.cMissingCover);
237
237
cd_message ("MP : sa taille est constante (%d)", myData.iCurrentFileSize);
239
cd_debug ("avant extraction : %s / %s\n", myData.cArtist, myData.cAlbum);
239
cd_debug ("MP - avant extraction : %s / %s\n", myData.cArtist, myData.cAlbum);
240
240
gchar *cURL = cd_extract_url_from_xml_file (myData.cCurrentXmlFile, &myData.cArtist, &myData.cAlbum, &myData.cTitle);
241
cd_debug ("apres extraction : %s / %s\n", myData.cArtist, myData.cAlbum);
242
cd_debug ("on s'apprete a telecharger la pochette : %s -> %s\n", cURL, myData.cCoverPath);
241
cd_debug ("MP - apres extraction : %s / %s\n", myData.cArtist, myData.cAlbum);
242
cd_debug ("MP - on s'apprete a telecharger la pochette : %s -> %s\n", cURL, myData.cCoverPath);
243
243
if (g_strstr_len (myData.cCoverPath, -1, "(null)") != NULL && myData.cArtist && myData.cAlbum)
245
cd_debug ("on corrige cCoverPath\n");
245
cd_debug ("MP - on corrige cCoverPath\n");
246
246
g_free (myData.cCoverPath);
247
247
if (myData.pCurrentHandeler->cCoverDir)
291
291
void cd_musicplayer_dl_cover (void)
293
cd_debug ("%s (%s, %s, %s)\n", __func__, myData.cArtist, myData.cAlbum, myData.cPlayingUri);
293
cd_debug ("MP - %s (%s, %s, %s)\n", __func__, myData.cArtist, myData.cAlbum, myData.cPlayingUri);
294
294
// on oublie ce qu'on etait en train de recuperer.
295
295
g_free (myData.cCurrentXmlFile);
296
296
myData.cCurrentXmlFile = NULL;