Ticket #12620: videolist.cpp.patch

File videolist.cpp.patch, 1.3 KB (added by William L. DeRieux IV <williamderieux@…>, 4 years ago)
  • branches/mythtv_github/devel-fixes-0.27/mythtv/mythtv/programs/mythfrontend/videolist.cpp

     
    424424        return ret;
    425425    }
    426426
     427    bool Delete(QString video_filename, VideoList &dummy)
     428    {
     429        bool ret = false;
     430        MetadataPtr mp = m_metadata.byFilename(video_filename);
     431        if (mp)
     432        {
     433            /* ensure we have the metadata for the correct file */
     434            if(mp->GetFilename().compare(video_filename) == 0)
     435            {
     436                ret = mp->DeleteFile();
     437                if (ret)
     438                {
     439                    ret = m_metadata.purgeByFilename(video_filename);
     440                    // Force refresh
     441                    m_metadata_list_type = VideoListImp::ltNone;
     442                }
     443            }
     444        }
     445
     446        return ret;
     447    }
     448
    427449    MythGenericTree *GetTreeRoot(void)
    428450    {
    429451        return video_tree_root.data();
     
    535557    return m_imp->Delete(video_id, *this);
    536558}
    537559
     560bool VideoList::Delete(QString video_filename)
     561{
     562    return m_imp->Delete(video_filename, *this);
     563}
     564
    538565MythGenericTree *VideoList::GetTreeRoot(void)
    539566{
    540567    return m_imp->GetTreeRoot();