From: <ny...@us...> - 2007-02-10 04:58:08
|
Revision: 323 http://svn.sourceforge.net/pmplib/?rev=323&view=rev Author: nyaochi Date: 2007-02-09 20:58:08 -0800 (Fri, 09 Feb 2007) Log Message: ----------- Notify empty artist or album names as a player might move such entries to "unknown" section. Modified Paths: -------------- trunk/pmplib/frontend/easypmp/common/database.c trunk/pmplib/frontend/easypmp/common/easypmp.h trunk/pmplib/frontend/easypmp/cui/main.c trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c Modified: trunk/pmplib/frontend/easypmp/common/database.c =================================================================== --- trunk/pmplib/frontend/easypmp/common/database.c 2007-02-10 04:38:49 UTC (rev 322) +++ trunk/pmplib/frontend/easypmp/common/database.c 2007-02-10 04:58:08 UTC (rev 323) @@ -209,7 +209,7 @@ ++num_obtained; } else { // Report the error. - if (progress(instance, EASYPMPP_MUSIC_GMI | EASYPMPSP_WARN_GMI, i, 0, filename) != 0) { + if (progress(instance, EASYPMPP_MUSIC_GMI | EASYPMPSP_WARN_FAILURE, i, 0, filename) != 0) { result = EASYPMPE_CANCEL; goto error_exit; } @@ -217,6 +217,14 @@ record->ts_update = timestamp; record->ts_import = ts_import; } + + // Warn empty artist or album name. + if (!record->artist || !*record->artist || !record->album || !*record->album) { + if (progress(instance, EASYPMPP_MUSIC_GMI | EASYPMPSP_WARN_EMPTY, i, 0, filename) != 0) { + result = EASYPMPE_CANCEL; + goto error_exit; + } + } } if (progress(instance, EASYPMPP_MUSIC_GMI | EASYPMPSP_END, num_obtained, 0, NULL) != 0) { result = EASYPMPE_CANCEL; Modified: trunk/pmplib/frontend/easypmp/common/easypmp.h =================================================================== --- trunk/pmplib/frontend/easypmp/common/easypmp.h 2007-02-10 04:38:49 UTC (rev 322) +++ trunk/pmplib/frontend/easypmp/common/easypmp.h 2007-02-10 04:58:08 UTC (rev 323) @@ -47,15 +47,16 @@ EASYPMPSP_START = 0x00000001, EASYPMPSP_PROGRESS = 0x00000002, EASYPMPSP_SKIPPED = 0x00000003, - EASYPMPSP_WARN_GMI = 0x00000004, - EASYPMPSP_WARN_PLAYLIST = 0x00000005, - EASYPMPSP_SKIP_PLAYLIST = 0x00000006, - EASYPMPSP_MISSING_MEDIA = 0x00000007, - EASYPMPSP_JSPL_ERROR = 0x00000008, - EASYPMPSP_JSPL_ERROR_POS = 0x00000009, - EASYPMPSP_JSPL_ERROR_LINE = 0x0000000A, - EASYPMPSP_JSPL_OUTPUT = 0x0000000B, - EASYPMPSP_END = 0x0000000C, + EASYPMPSP_WARN_FAILURE = 0x00000004, + EASYPMPSP_WARN_EMPTY = 0x00000005, + EASYPMPSP_WARN_PLAYLIST = 0x00000006, + EASYPMPSP_SKIP_PLAYLIST = 0x00000007, + EASYPMPSP_MISSING_MEDIA = 0x00000008, + EASYPMPSP_JSPL_ERROR = 0x00000009, + EASYPMPSP_JSPL_ERROR_POS = 0x0000000A, + EASYPMPSP_JSPL_ERROR_LINE = 0x0000000B, + EASYPMPSP_JSPL_OUTPUT = 0x0000000C, + EASYPMPSP_END = 0x0000000D, }; enum { Modified: trunk/pmplib/frontend/easypmp/cui/main.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/main.c 2007-02-10 04:38:49 UTC (rev 322) +++ trunk/pmplib/frontend/easypmp/cui/main.c 2007-02-10 04:58:08 UTC (rev 323) @@ -114,11 +114,16 @@ case EASYPMPP_MUSIC_GMI|EASYPMPSP_PROGRESS: easypmp_progress_num_str(fpo, param_int+1, filepath_skippath(param_str)); break; - case EASYPMPP_MUSIC_GMI|EASYPMPSP_WARN_GMI: + case EASYPMPP_MUSIC_GMI|EASYPMPSP_WARN_FAILURE: console_clearln(fpo); fprintf(fpe, " WARNING: Could not obtain the media information\n"); fprints(fpe, " %s\n", param_str); break; + case EASYPMPP_MUSIC_GMI|EASYPMPSP_WARN_EMPTY: + console_clearln(fpo); + fprintf(fpe, " WARNING: Empty artist or album name found\n"); + fprints(fpe, " %s\n", param_str); + break; case EASYPMPP_MUSIC_GMI|EASYPMPSP_END: console_clearln(fpo); fprintf(fpo, " %d files were imported\n", param_int); Modified: trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h =================================================================== --- trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h 2007-02-10 04:38:49 UTC (rev 322) +++ trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h 2007-02-10 04:58:08 UTC (rev 323) @@ -568,6 +568,14 @@ dlg->m_ctrlProgress.SetPos(param_int); dlg->write_log(LL_TRACE, _T("%s"), UCS2CT(param_str)); break; + case EASYPMPP_MUSIC_GMI|EASYPMPSP_WARN_FAILURE: + dlg->m_bFailed = TRUE; + dlg->write_log(LL_WARNING, _T("WARNING: Could not obtain the media information: %s"), UCS2CT(param_str)); + break; + case EASYPMPP_MUSIC_GMI|EASYPMPSP_WARN_EMPTY: + dlg->m_bFailed = TRUE; + dlg->write_log(LL_WARNING, _T("WARNING: Empty artist or album name found: %s"), UCS2CT(param_str)); + break; case EASYPMPP_MUSIC_GMI|EASYPMPSP_END: dlg->m_ctrlProgress.ShowWindow(SW_HIDE); //dlg->m_ctrlProgress.DestroyWindow(); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c 2007-02-10 04:38:49 UTC (rev 322) +++ trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c 2007-02-10 04:58:08 UTC (rev 323) @@ -228,7 +228,7 @@ } *p++ = 0; //strcpy(model->name, line); - strcpy(model->name, "iRiver H10"); + strcpy(model->name, "H10"); // Parse and check version number. q = strchr(p, '-'); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-02-10 04:38:49 UTC (rev 322) +++ trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-02-10 04:58:08 UTC (rev 323) @@ -203,7 +203,7 @@ } // Obtain the model name. - strcpy(model->name, "MSI MEGA PLAYER 540"); + strcpy(model->name, "MEGA PLAYER 540"); memset(model->version, 0, sizeof(model->version)); strncpy(model->version, buff+0x1F, 8); strcpy(model->language, ""); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |