| 313 | QStringList Dvr::GetRecGroupList() |
| 314 | { |
| 315 | MSqlQuery query(MSqlQuery::InitCon()); |
| 316 | |
| 317 | QString querystr = QString("SELECT DISTINCT recgroup FROM record"); |
| 318 | |
| 319 | query.prepare(querystr); |
| 320 | |
| 321 | QStringList result; |
| 322 | if (!query.exec()) |
| 323 | { |
| 324 | MythDB::DBError("GetRecGroupList record", query); |
| 325 | return result; |
| 326 | } |
| 327 | |
| 328 | while (query.next()) |
| 329 | result << query.value(0).toString(); |
| 330 | |
| 331 | querystr = QString("SELECT DISTINCT recgroup FROM recorded"); |
| 332 | |
| 333 | query.prepare(querystr); |
| 334 | |
| 335 | if (!query.exec()) |
| 336 | { |
| 337 | MythDB::DBError("GetRecGroupList recorded", query); |
| 338 | return result; |
| 339 | } |
| 340 | |
| 341 | while (query.next()) |
| 342 | { |
| 343 | QString value = query.value(0).toString(); |
| 344 | |
| 345 | if (!result.contains(value)) |
| 346 | result << value; |
| 347 | } |
| 348 | |
| 349 | result.sort(); |
| 350 | |
| 351 | return result; |
| 352 | } |
| 353 | |
| 354 | ///////////////////////////////////////////////////////////////////////////// |
| 355 | // |
| 356 | ///////////////////////////////////////////////////////////////////////////// |
| 357 | |
| 358 | QStringList Dvr::GetTitleList() |
| 359 | { |
| 360 | MSqlQuery query(MSqlQuery::InitCon()); |
| 361 | |
| 362 | QString querystr = QString("SELECT DISTINCT title FROM recorded"); |
| 363 | |
| 364 | query.prepare(querystr); |
| 365 | |
| 366 | QStringList result; |
| 367 | if (!query.exec()) |
| 368 | { |
| 369 | MythDB::DBError("GetTitleList recorded", query); |
| 370 | return result; |
| 371 | } |
| 372 | |
| 373 | while (query.next()) |
| 374 | result << query.value(0).toString(); |
| 375 | |
| 376 | result.sort(); |
| 377 | |
| 378 | return result; |
| 379 | } |
| 380 | |
| 381 | ///////////////////////////////////////////////////////////////////////////// |
| 382 | // |
| 383 | ///////////////////////////////////////////////////////////////////////////// |
| 384 | |
| 604 | bool Dvr::EditRecordSchedule ( int nRecordId, |
| 605 | bool bInactive, |
| 606 | uint nSeason, |
| 607 | uint nEpisode, |
| 608 | QString sInetref, |
| 609 | int nFindId, |
| 610 | QString sType, |
| 611 | QString sSearchType, |
| 612 | int nRecPriority, |
| 613 | uint nPreferredInput, |
| 614 | int nStartOffset, |
| 615 | int nEndOffset, |
| 616 | QString sDupMethod, |
| 617 | QString sDupIn, |
| 618 | uint nFilter, |
| 619 | QString sRecProfile, |
| 620 | QString sRecGroup, |
| 621 | QString sStorageGroup, |
| 622 | QString sPlayGroup, |
| 623 | bool bAutoExpire, |
| 624 | int nMaxEpisodes, |
| 625 | bool bMaxNewest, |
| 626 | bool bAutoCommflag, |
| 627 | bool bAutoTranscode, |
| 628 | bool bAutoMetaLookup, |
| 629 | bool bAutoUserJob1, |
| 630 | bool bAutoUserJob2, |
| 631 | bool bAutoUserJob3, |
| 632 | bool bAutoUserJob4, |
| 633 | int nTranscoder) |
| 634 | { |
| 635 | bool bResult = false; |
| 636 | |
| 637 | if (nRecordId <= 0 ) |
| 638 | throw( QString("Record ID appears invalid.")); |
| 639 | |
| 640 | RecordingRule pRule; |
| 641 | pRule.m_recordID = nRecordId; |
| 642 | pRule.Load(); |
| 643 | |
| 644 | if (pRule.IsLoaded()) |
| 645 | { |
| 646 | pRule.m_isInactive = bInactive; |
| 647 | if (sType.isEmpty()) |
| 648 | sType = "single"; |
| 649 | |
| 650 | if (sSearchType.isEmpty()) |
| 651 | sSearchType = "none"; |
| 652 | |
| 653 | if (sDupMethod.isEmpty()) |
| 654 | sDupMethod = "subtitleanddescription"; |
| 655 | |
| 656 | if (sDupIn.isEmpty()) |
| 657 | sDupIn = "all"; |
| 658 | |
| 659 | pRule.m_type = recTypeFromString(sType); |
| 660 | pRule.m_searchType = searchTypeFromString(sSearchType); |
| 661 | pRule.m_dupMethod = dupMethodFromString(sDupMethod); |
| 662 | pRule.m_dupIn = dupInFromString(sDupIn); |
| 663 | |
| 664 | if (sRecProfile.isEmpty()) |
| 665 | sRecProfile = "Default"; |
| 666 | |
| 667 | if (sRecGroup.isEmpty()) |
| 668 | sRecGroup = "Default"; |
| 669 | |
| 670 | if (sStorageGroup.isEmpty()) |
| 671 | sStorageGroup = "Default"; |
| 672 | |
| 673 | if (sPlayGroup.isEmpty()) |
| 674 | sPlayGroup = "Default"; |
| 675 | |
| 676 | pRule.m_recProfile = sRecProfile; |
| 677 | pRule.m_recGroup = sRecGroup; |
| 678 | pRule.m_storageGroup = sStorageGroup; |
| 679 | pRule.m_playGroup = sPlayGroup; |
| 680 | |
| 681 | pRule.m_isInactive = bInactive; |
| 682 | |
| 683 | pRule.m_season = nSeason; |
| 684 | pRule.m_episode = nEpisode; |
| 685 | pRule.m_inetref = sInetref; |
| 686 | pRule.m_findid = nFindId; |
| 687 | |
| 688 | pRule.m_recPriority = nRecPriority; |
| 689 | pRule.m_prefInput = nPreferredInput; |
| 690 | pRule.m_startOffset = nStartOffset; |
| 691 | pRule.m_endOffset = nEndOffset; |
| 692 | pRule.m_filter = nFilter; |
| 693 | |
| 694 | pRule.m_autoExpire = bAutoExpire; |
| 695 | pRule.m_maxEpisodes = nMaxEpisodes; |
| 696 | pRule.m_maxNewest = bMaxNewest; |
| 697 | |
| 698 | pRule.m_autoCommFlag = bAutoCommflag; |
| 699 | pRule.m_autoTranscode = bAutoTranscode; |
| 700 | pRule.m_autoMetadataLookup = bAutoMetaLookup; |
| 701 | |
| 702 | pRule.m_autoUserJob1 = bAutoUserJob1; |
| 703 | pRule.m_autoUserJob2 = bAutoUserJob2; |
| 704 | pRule.m_autoUserJob3 = bAutoUserJob3; |
| 705 | pRule.m_autoUserJob4 = bAutoUserJob4; |
| 706 | |
| 707 | pRule.m_transcoder = nTranscoder; |
| 708 | |
| 709 | pRule.Save(); |
| 710 | bResult = true; |
| 711 | } |
| 712 | return bResult; |
| 713 | } |
| 714 | |