Ticket #1647: videolist.patch

File videolist.patch, 3.3 KB (added by david.asher@…, 20 years ago)
  • mythvideo/mythvideo/videolist.h

     
    4545        GenericTree *addDirNode(GenericTree *where_to_add,
    4646                                                        const QString& dname);
    4747        GenericTree *addFileNode(GenericTree *where_to_add,
    48                                                 const QString& fname, int id);
     48                                 const QString& fname, const QString& title, int id);
    4949
    5050        bool m_ListUnknown;
    5151        bool m_LoadMetaData;
  • mythvideo/mythvideo/videolist.cpp

     
    221221        file_string.remove(0, prefix.length());
    222222        if (flatlist)
    223223        {
    224             video_tree_root->addNode(file_string, count, true);
     224            video_tree_root->addNode(myData->Title(), count, true);
    225225            nitems++;
    226226        }
    227227        else
    228228        {
    229             where_to_add = addFileNode(where_to_add, file_string, count);
     229            where_to_add = addFileNode(where_to_add, file_string, myData->Title(), count);
    230230        }
    231231        metas.append(*myData);
    232232        delete myData;
     
    336336        }
    337337
    338338        Metadata *myData = new Metadata;
    339         // See if we can find this filename in DB
     339        // See if we can/should find this filename in DB
    340340        myData->setFilename(file_string);
    341         if (m_LoadMetaData) {
    342             if(!myData->fillDataFromFilename()) {
    343                 // No, fake it.
    344                 QString base_name = file_string.section("/", -1);
    345                 myData->setTitle(base_name.section(".", 0, -2));
    346             }
    347         }
    348         else
    349         {
     341        if (!m_LoadMetaData || !myData->fillDataFromFilename()) {
     342            // No, fake it.
    350343            QString base_name = file_string.section("/", -1);
    351344            myData->setTitle(base_name.section(".", 0, -2));
    352 
    353345        }
    354346
    355347        metas.append(*myData);
     
    358350        {
    359351            file_string.remove(0, prefix.length());
    360352            if (!flatlist) {
    361                 where_to_add = addFileNode(where_to_add, file_string, i);
     353                where_to_add = addFileNode(where_to_add, file_string, myData->Title(), i);
    362354            }
    363355            else {
    364                 video_tree_root->addNode(file_string, i, true);
     356                video_tree_root->addNode(myData->Title(), i, true);
    365357                nitems++;
    366358            }
    367359        }
     
    423415}
    424416
    425417GenericTree *VideoList::addFileNode(GenericTree *where_to_add,
    426                                                 const QString& fname, int index)
     418                                    const QString& fname, const QString& title, int index)
    427419{
    428420    int a_counter = 0;
    429421    GenericTree *sub_node;
     
    434426    {
    435427        if(a_counter + 1 >= (int) list.count()) // video
    436428        {
    437             QString title = (*an_it);
    438             sub_node = where_to_add->addNode(title.section(".",0,-2),
     429            sub_node = where_to_add->addNode(title,
    439430                    index, true);
    440431            sub_node->setAttribute(0, ORDER_ITEM);
    441432            sub_node->setOrderingIndex(0);