branch | 3rded |
changeset 390 | d7abecc9d189 |
parent 343 | 9c56bf585696 |
345:702ba9ffe210 | 390:d7abecc9d189 |
---|---|
36 { |
36 { |
37 } |
37 } |
38 |
38 |
39 EXPORT_C CShowEngine::~CShowEngine() |
39 EXPORT_C CShowEngine::~CShowEngine() |
40 { |
40 { |
41 DP("CShowEngine::~CShowEngine BEGIN"); |
|
41 delete iShowClient; |
42 delete iShowClient; |
42 iObservers.Close(); |
43 iObservers.Close(); |
43 delete iShowDownloading; |
44 delete iShowDownloading; |
44 delete iMetaDataReader; |
45 delete iMetaDataReader; |
45 iApaSession.Close(); |
46 iApaSession.Close(); |
47 DP("CShowEngine::~CShowEngine END"); |
|
46 } |
48 } |
47 |
49 |
48 EXPORT_C CShowEngine* CShowEngine::NewL(CPodcastModel& aPodcastModel) |
50 EXPORT_C CShowEngine* CShowEngine::NewL(CPodcastModel& aPodcastModel) |
49 { |
51 { |
50 CShowEngine* self = new (ELeave) CShowEngine(aPodcastModel); |
52 CShowEngine* self = new (ELeave) CShowEngine(aPodcastModel); |
372 |
374 |
373 EXPORT_C CShowInfo* CShowEngine::GetShowByUidL(TUint aShowUid) |
375 EXPORT_C CShowInfo* CShowEngine::GetShowByUidL(TUint aShowUid) |
374 { |
376 { |
375 return DBGetShowByUidL(aShowUid); |
377 return DBGetShowByUidL(aShowUid); |
376 } |
378 } |
379 |
|
377 CShowInfo* CShowEngine::DBGetShowByUidL(TUint aUid) |
380 CShowInfo* CShowEngine::DBGetShowByUidL(TUint aUid) |
378 { |
381 { |
379 DP("CShowEngine::DBGetShowByUid"); |
382 DP("CShowEngine::DBGetShowByUid"); |
380 CShowInfo *showInfo = NULL; |
383 CShowInfo *showInfo = NULL; |
381 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows where uid=%u"); |
384 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, deletedate from shows where uid=%u"); |
382 iSqlBuffer.Format(KSqlStatement, aUid); |
385 iSqlBuffer.Format(KSqlStatement, aUid); |
383 |
386 |
384 sqlite3_stmt *st; |
387 sqlite3_stmt *st; |
385 |
388 |
386 //DP1("SQL: %S", &iSqlBuffer.Left(KSqlDPLen)); |
389 //DP1("SQL: %S", &iSqlBuffer.Left(KSqlDPLen)); |
406 |
409 |
407 EXPORT_C CShowInfo* CShowEngine::DBGetShowByFileNameL(TFileName aFileName) |
410 EXPORT_C CShowInfo* CShowEngine::DBGetShowByFileNameL(TFileName aFileName) |
408 { |
411 { |
409 DP("CShowEngine::DBGetShowByUid"); |
412 DP("CShowEngine::DBGetShowByUid"); |
410 CShowInfo *showInfo = NULL; |
413 CShowInfo *showInfo = NULL; |
411 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows where filename=\"%S\""); |
414 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror, deletedate from shows where filename=\"%S\""); |
412 iSqlBuffer.Format(KSqlStatement, &aFileName); |
415 iSqlBuffer.Format(KSqlStatement, &aFileName); |
413 |
416 |
414 sqlite3_stmt *st; |
417 sqlite3_stmt *st; |
415 |
418 |
416 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
419 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
433 } |
436 } |
434 |
437 |
435 void CShowEngine::DBGetAllShowsL(RShowInfoArray& aShowArray) |
438 void CShowEngine::DBGetAllShowsL(RShowInfoArray& aShowArray) |
436 { |
439 { |
437 DP("CShowEngine::DBGetAllShows"); |
440 DP("CShowEngine::DBGetAllShows"); |
438 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype from shows"); |
441 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror, deletedate from shows"); |
439 iSqlBuffer.Format(KSqlStatement); |
442 iSqlBuffer.Format(KSqlStatement); |
440 |
443 |
441 sqlite3_stmt *st; |
444 sqlite3_stmt *st; |
442 |
445 |
443 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
446 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
461 } |
464 } |
462 |
465 |
463 void CShowEngine::DBGetAllDownloadsL(RShowInfoArray& aShowArray) |
466 void CShowEngine::DBGetAllDownloadsL(RShowInfoArray& aShowArray) |
464 { |
467 { |
465 DP("CShowEngine::DBGetAllDownloads"); |
468 DP("CShowEngine::DBGetAllDownloads"); |
466 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, shows.uid, showsize, trackno, pubdate, showtype, lasterror from downloads, shows where downloads.uid=shows.uid"); |
469 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, shows.uid, showsize, trackno, pubdate, showtype, lasterror, deletedate from downloads, shows where downloads.uid=shows.uid"); |
467 iSqlBuffer.Format(KSqlStatement); |
470 iSqlBuffer.Format(KSqlStatement); |
468 |
471 |
469 #ifndef DONT_SORT_SQL |
472 #ifndef DONT_SORT_SQL |
470 _LIT(KSqlSort, " order by dl_index"); |
473 _LIT(KSqlSort, " order by dl_index"); |
471 iSqlBuffer.Append(KSqlSort); |
474 iSqlBuffer.Append(KSqlSort); |
511 { |
514 { |
512 User::Leave(KErrCorrupt); |
515 User::Leave(KErrCorrupt); |
513 } |
516 } |
514 } |
517 } |
515 |
518 |
519 void CShowEngine::DBGetOldShowsL(RShowInfoArray& aShowArray) |
|
520 { |
|
521 DP("CShowEngine::DBGetOldShowsL BEGIN"); |
|
522 TTime now; |
|
523 now.HomeTime(); |
|
524 // TTimeIntervalYears years(5); |
|
525 // now += years; |
|
526 |
|
527 _LIT(KSqlStatement, "select filename from shows where downloadstate=%d and deletedate != 0 and deletedate < \"%Ld\""); |
|
528 iSqlBuffer.Format(KSqlStatement, EDownloaded, now.Int64()); |
|
529 |
|
530 sqlite3_stmt *st; |
|
531 |
|
532 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
533 &st, (const void**) NULL); |
|
534 |
|
535 if (rc == SQLITE_OK) |
|
536 { |
|
537 rc = sqlite3_step(st); |
|
538 Cleanup_sqlite3_finalize_PushL(st); |
|
539 while (rc == SQLITE_ROW) |
|
540 { |
|
541 CShowInfo* showInfo = CShowInfo::NewLC(); |
|
542 |
|
543 const void *filez = sqlite3_column_text16(st, 0); |
|
544 TPtrC16 file((const TUint16*) filez); |
|
545 showInfo->SetFileNameL(file); |
|
546 |
|
547 aShowArray.Append(showInfo); |
|
548 CleanupStack::Pop(showInfo); |
|
549 rc = sqlite3_step(st); |
|
550 } |
|
551 CleanupStack::PopAndDestroy();//st |
|
552 } |
|
553 else |
|
554 { |
|
555 User::Leave(KErrCorrupt); |
|
556 } |
|
557 |
|
558 // now update DB |
|
559 _LIT(KSqlStatement2, "update shows set downloadstate=%d and deletedate = 0 where downloadstate=%d and deletedate != 0 and deletedate < \"%Ld\""); |
|
560 iSqlBuffer.Format(KSqlStatement2, ENotDownloaded, EDownloaded, now.Int64()); |
|
561 |
|
562 |
|
563 rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
|
564 &st, (const void**) NULL); |
|
565 |
|
566 if (rc == SQLITE_OK) |
|
567 { |
|
568 rc = sqlite3_step(st); |
|
569 Cleanup_sqlite3_finalize_PushL(st); |
|
570 CleanupStack::PopAndDestroy();//st |
|
571 } |
|
572 |
|
573 |
|
574 DP("CShowEngine::DBGetOldShowsL END"); |
|
575 } |
|
576 |
|
516 CShowInfo* CShowEngine::DBGetNextDownloadL() |
577 CShowInfo* CShowEngine::DBGetNextDownloadL() |
517 { |
578 { |
518 DP("CShowEngine::DBGetNextDownload"); |
579 DP("CShowEngine::DBGetNextDownload"); |
519 CShowInfo *showInfo = NULL; |
580 CShowInfo *showInfo = NULL; |
520 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, shows.uid, showsize, trackno, pubdate, showtype, lasterror from downloads, shows where downloads.uid=shows.uid"); |
581 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, shows.uid, showsize, trackno, pubdate, showtype, lasterror, deletedate from downloads, shows where downloads.uid=shows.uid"); |
521 iSqlBuffer.Format(KSqlStatement); |
582 iSqlBuffer.Format(KSqlStatement); |
522 |
583 |
523 #ifdef DONT_SORT_SQL |
584 #ifdef DONT_SORT_SQL |
524 _LIT(KSqlSort, " limit 1"); |
585 _LIT(KSqlSort, " limit 1"); |
525 iSqlBuffer.Append(KSqlSort); |
586 iSqlBuffer.Append(KSqlSort); |
558 } |
619 } |
559 |
620 |
560 void CShowEngine::DBGetShowsByFeedL(RShowInfoArray& aShowArray, TUint aFeedUid) |
621 void CShowEngine::DBGetShowsByFeedL(RShowInfoArray& aShowArray, TUint aFeedUid) |
561 { |
622 { |
562 DP1("CShowEngine::DBGetShowsByFeed BEGIN, feedUid=%u", aFeedUid); |
623 DP1("CShowEngine::DBGetShowsByFeed BEGIN, feedUid=%u", aFeedUid); |
563 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where feeduid=%u"); |
624 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror, deletedate from shows where feeduid=%u"); |
564 iSqlBuffer.Format(KSqlStatement, aFeedUid); |
625 iSqlBuffer.Format(KSqlStatement, aFeedUid); |
565 |
|
566 if (iShowFilter == ENewShows) |
|
567 { |
|
568 _LIT(KSqlStatementNewShows, " and playstate = 0"); // ENeverPlayed |
|
569 iSqlBuffer.Append(KSqlStatementNewShows); |
|
570 } |
|
571 else if (iShowFilter == EDownloadedShows) |
|
572 { |
|
573 _LIT(KSqlStatementDownloadedShows, " and downloadstate = 4"); // EDownloaded |
|
574 iSqlBuffer.Append(KSqlStatementDownloadedShows); |
|
575 } |
|
576 else if (iShowFilter == ENewAndDownloadedShows) |
|
577 { |
|
578 _LIT(KSqlStatementDownloadedAndNewShows, " and (downloadstate = 4 or playstate = 0)"); // EDownloaded or ENeverPlayed |
|
579 iSqlBuffer.Append(KSqlStatementDownloadedAndNewShows); |
|
580 |
|
581 } |
|
582 |
626 |
583 #ifndef DONT_SORT_SQL |
627 #ifndef DONT_SORT_SQL |
584 _LIT(KSqlOrderByDate, " order by pubdate desc"); |
628 _LIT(KSqlOrderByDate, " order by pubdate desc"); |
585 iSqlBuffer.Append(KSqlOrderByDate); |
629 iSqlBuffer.Append(KSqlOrderByDate); |
586 #endif |
630 #endif |
648 } |
692 } |
649 |
693 |
650 void CShowEngine::DBGetDownloadedShowsL(RShowInfoArray& aShowArray) |
694 void CShowEngine::DBGetDownloadedShowsL(RShowInfoArray& aShowArray) |
651 { |
695 { |
652 DP("CShowEngine::DBGetDownloadedShows"); |
696 DP("CShowEngine::DBGetDownloadedShows"); |
653 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where downloadstate=%u"); |
697 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror, deletedate from shows where downloadstate=%u"); |
654 iSqlBuffer.Format(KSqlStatement, EDownloaded); |
698 iSqlBuffer.Format(KSqlStatement, EDownloaded); |
655 |
699 |
656 #ifndef DONT_SORT_SQL |
700 #ifndef DONT_SORT_SQL |
657 _LIT(KSqlSort, " order by title"); |
701 _LIT(KSqlSort, " order by title"); |
658 iSqlBuffer.Append(KSqlSort); |
702 iSqlBuffer.Append(KSqlSort); |
684 } |
728 } |
685 |
729 |
686 void CShowEngine::DBGetNewShowsL(RShowInfoArray& aShowArray) |
730 void CShowEngine::DBGetNewShowsL(RShowInfoArray& aShowArray) |
687 { |
731 { |
688 DP("CShowEngine::DBGetNewShows"); |
732 DP("CShowEngine::DBGetNewShows"); |
689 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where playstate=%u"); |
733 _LIT(KSqlStatement, "select url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, lasterror from shows where playstate=%u order by pubdate desc"); |
734 |
|
690 iSqlBuffer.Format(KSqlStatement, ENeverPlayed); |
735 iSqlBuffer.Format(KSqlStatement, ENeverPlayed); |
691 |
736 |
692 sqlite3_stmt *st; |
737 sqlite3_stmt *st; |
693 |
738 |
694 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
739 int rc = sqlite3_prepare16_v2(&iDB, (const void*) iSqlBuffer.PtrZ(), -1, |
807 TUint showtype = sqlite3_column_int(st, 13); |
852 TUint showtype = sqlite3_column_int(st, 13); |
808 showInfo->SetShowType((TShowType) showtype); |
853 showInfo->SetShowType((TShowType) showtype); |
809 |
854 |
810 TInt lasterror = sqlite3_column_int(st, 14); |
855 TInt lasterror = sqlite3_column_int(st, 14); |
811 showInfo->SetLastError(lasterror); |
856 showInfo->SetLastError(lasterror); |
857 |
|
858 sqlite3_int64 deletedate = sqlite3_column_int64(st, 15); |
|
859 TTime timedeletedate(deletedate); |
|
860 showInfo->SetDeleteDate(timedeletedate); |
|
812 } |
861 } |
813 |
862 |
814 void CShowEngine::DBAddShowL(const CShowInfo& aItem) |
863 void CShowEngine::DBAddShowL(const CShowInfo& aItem) |
815 { |
864 { |
816 DP2("CShowEngine::DBAddShow, title=%S, URL=%S", &aItem.Title(), &aItem.Url()); |
865 DP2("CShowEngine::DBAddShow, title=%S, URL=%S", &aItem.Title(), &aItem.Url()); |
823 HBufC* descBuf = HBufC::NewLC(KMaxLineLength); |
872 HBufC* descBuf = HBufC::NewLC(KMaxLineLength); |
824 TPtr descPtr(descBuf->Des()); |
873 TPtr descPtr(descBuf->Des()); |
825 descPtr.Copy(aItem.Description()); |
874 descPtr.Copy(aItem.Description()); |
826 PodcastUtils::SQLEncode(descPtr); |
875 PodcastUtils::SQLEncode(descPtr); |
827 |
876 |
828 _LIT(KSqlStatement, "insert into shows (url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype) values (\"%S\",\"%S\", \"%S\", \"%S\", \"%Lu\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%Lu\", \"%d\")"); |
877 _LIT(KSqlStatement, "insert into shows (url, title, description, filename, position, playtime, playstate, downloadstate, feeduid, uid, showsize, trackno, pubdate, showtype, deletedate) values (\"%S\",\"%S\", \"%S\", \"%S\", \"%Lu\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%u\", \"%Lu\", \"%d\", \"%Lu\")"); |
829 |
878 |
830 iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr, |
879 iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr, |
831 &aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(), |
880 &aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(), |
832 aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(), |
881 aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(), |
833 aItem.Uid(), aItem.ShowSize(), aItem.TrackNo(), |
882 aItem.Uid(), aItem.ShowSize(), aItem.TrackNo(), |
834 aItem.PubDate().Int64(), aItem.ShowType()); |
883 aItem.PubDate().Int64(), aItem.ShowType(), aItem.DeleteDate().Int64()); |
835 |
884 |
836 CleanupStack::PopAndDestroy(descBuf); |
885 CleanupStack::PopAndDestroy(descBuf); |
837 CleanupStack::PopAndDestroy(titleBuf); |
886 CleanupStack::PopAndDestroy(titleBuf); |
838 |
887 |
839 sqlite3_stmt *st; |
888 sqlite3_stmt *st; |
896 HBufC* descBuf = HBufC::NewLC(KMaxLineLength); |
945 HBufC* descBuf = HBufC::NewLC(KMaxLineLength); |
897 TPtr descPtr(descBuf->Des()); |
946 TPtr descPtr(descBuf->Des()); |
898 descPtr.Copy(aItem.Description()); |
947 descPtr.Copy(aItem.Description()); |
899 PodcastUtils::SQLEncode(descPtr); |
948 PodcastUtils::SQLEncode(descPtr); |
900 |
949 |
901 _LIT(KSqlStatement, "update shows set url=\"%S\", title=\"%S\", description=\"%S\", filename=\"%S\", position=\"%Lu\", playtime=\"%u\", playstate=\"%u\", downloadstate=\"%u\", feeduid=\"%u\", showsize=\"%u\", trackno=\"%u\",pubdate=\"%Lu\", showtype=\"%d\", lasterror=\"%d\" where uid=\"%u\""); |
950 _LIT(KSqlStatement, "update shows set url=\"%S\", title=\"%S\", description=\"%S\", filename=\"%S\", position=\"%Lu\", playtime=\"%u\", playstate=\"%u\", downloadstate=\"%u\", feeduid=\"%u\", showsize=\"%u\", trackno=\"%u\",pubdate=\"%Lu\", showtype=\"%d\", lasterror=\"%d\", deletedate=\"%Lu\" where uid=\"%u\""); |
902 iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr, |
951 iSqlBuffer.Format(KSqlStatement, &aItem.Url(), &titlePtr, &descPtr, |
903 &aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(), |
952 &aItem.FileName(), aItem.Position().Int64(), aItem.PlayTime(), |
904 aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(), |
953 aItem.PlayState(), aItem.DownloadState(), aItem.FeedUid(), |
905 aItem.ShowSize(), aItem.TrackNo(), aItem.PubDate().Int64(), |
954 aItem.ShowSize(), aItem.TrackNo(), aItem.PubDate().Int64(), |
906 aItem.ShowType(), aItem.LastError(), aItem.Uid()); |
955 aItem.ShowType(), aItem.LastError(), aItem.DeleteDate().Int64(), aItem.Uid()); |
907 |
956 |
908 CleanupStack::PopAndDestroy(descBuf); |
957 CleanupStack::PopAndDestroy(descBuf); |
909 CleanupStack::PopAndDestroy(titleBuf); |
958 CleanupStack::PopAndDestroy(titleBuf); |
910 |
959 |
911 sqlite3_stmt *st; |
960 sqlite3_stmt *st; |
1426 } |
1475 } |
1427 |
1476 |
1428 EXPORT_C void CShowEngine::UpdateShowL(CShowInfo& aInfo) |
1477 EXPORT_C void CShowEngine::UpdateShowL(CShowInfo& aInfo) |
1429 { |
1478 { |
1430 DBUpdateShowL(aInfo); |
1479 DBUpdateShowL(aInfo); |
1480 |
|
1481 // hack to ensure change in playstate is stored for the show actively downloading |
|
1482 if (iShowDownloading && iShowDownloading->Uid() == aInfo.Uid()) |
|
1483 { |
|
1484 iShowDownloading->SetPlayState(aInfo.PlayState()); |
|
1485 } |
|
1431 } |
1486 } |
1432 |
1487 |
1433 EXPORT_C CMetaDataReader& CShowEngine::MetaDataReader() |
1488 EXPORT_C CMetaDataReader& CShowEngine::MetaDataReader() |
1434 { |
1489 { |
1435 return *iMetaDataReader; |
1490 return *iMetaDataReader; |
1436 } |
1491 } |
1437 |
1492 |
1438 void CShowEngine::FileError(TUint /*aError*/) |
1493 void CShowEngine::FileError(TUint /*aError*/) |
1439 { |
1494 { |
1440 iDownloadErrors = KMaxDownloadErrors; |
1495 iDownloadErrors = KMaxDownloadErrors; |
1496 } |
|
1497 |
|
1498 EXPORT_C void CShowEngine::ExpireOldShows() |
|
1499 { |
|
1500 DP("CShowEngine::ExpireOldShows BEGIN"); |
|
1501 RShowInfoArray oldShowsArray; |
|
1502 |
|
1503 TRAPD(err, DBGetOldShowsL(oldShowsArray)); |
|
1504 |
|
1505 if (err == KErrNone) |
|
1506 { |
|
1507 for (int i=0;i<oldShowsArray.Count();i++) |
|
1508 { |
|
1509 DP1(" deleting %S", &oldShowsArray[i]->FileName()); |
|
1510 BaflUtils::DeleteFile(iPodcastModel.FsSession(), oldShowsArray[i]->FileName()); |
|
1511 } |
|
1512 } |
|
1513 DP("CShowEngine::ExpireOldShows END"); |
|
1441 } |
1514 } |
1442 |
1515 |
1443 EXPORT_C void CShowEngine::CheckForDeletedShows(TUint aFeedUid) |
1516 EXPORT_C void CShowEngine::CheckForDeletedShows(TUint aFeedUid) |
1444 { |
1517 { |
1445 RShowInfoArray shows; |
1518 RShowInfoArray shows; |
1465 shows[i]->SetPlayState(EPlayed); |
1538 shows[i]->SetPlayState(EPlayed); |
1466 TRAP_IGNORE(DBUpdateShowL(*shows[i])); |
1539 TRAP_IGNORE(DBUpdateShowL(*shows[i])); |
1467 } |
1540 } |
1468 } |
1541 } |
1469 } |
1542 } |
1470 } |
|
1471 |
|
1472 EXPORT_C void CShowEngine::SetShowFilter(TShowFilter aFilter) |
|
1473 { |
|
1474 iShowFilter = aFilter; |
|
1475 } |
1543 } |
1476 |
1544 |
1477 EXPORT_C void CShowEngine::MoveDownloadUpL(TUint aUid) |
1545 EXPORT_C void CShowEngine::MoveDownloadUpL(TUint aUid) |
1478 { |
1546 { |
1479 DP("CShowEngine::MoveDownLoadUpL"); |
1547 DP("CShowEngine::MoveDownLoadUpL"); |
1597 else |
1665 else |
1598 { |
1666 { |
1599 User::Leave(KErrCorrupt); |
1667 User::Leave(KErrCorrupt); |
1600 } |
1668 } |
1601 } |
1669 } |
1670 |
|
1671 EXPORT_C void CShowEngine::PostPlayHandling(CShowInfo *aShow) |
|
1672 { |
|
1673 DP("CShowEngine::PostPlayHandling BEGIN"); |
|
1674 if (!aShow) |
|
1675 return; |
|
1676 |
|
1677 aShow->SetPlayState(EPlayed); |
|
1678 |
|
1679 TAutoDeleteSetting deleteSetting = iPodcastModel.SettingsEngine().DeleteAutomatically(); |
|
1680 TTimeIntervalDays daysAhead; |
|
1681 |
|
1682 switch (deleteSetting) |
|
1683 { |
|
1684 case EAutoDeleteOff: |
|
1685 break; |
|
1686 case EAutoDeleteAfter1Day: |
|
1687 daysAhead = 1; |
|
1688 break; |
|
1689 case EAutoDeleteAfter7Days: |
|
1690 daysAhead = 7; |
|
1691 break; |
|
1692 } |
|
1693 |
|
1694 if (daysAhead.Int() > 0) |
|
1695 { |
|
1696 TTime deleteDate; |
|
1697 deleteDate.HomeTime(); |
|
1698 deleteDate += daysAhead; |
|
1699 aShow->SetDeleteDate(deleteDate); |
|
1700 DP2("Setting show %S to be deleted on the %d th", &aShow->Title(), deleteDate.DayNoInMonth()+1); |
|
1701 } |
|
1702 |
|
1703 UpdateShowL(*aShow); |
|
1704 DP("CShowEngine::PostPlayHandling END"); |
|
1705 } |