Ticket #1647: videolist.patch
File videolist.patch, 3.3 KB (added by , 20 years ago) |
---|
-
mythvideo/mythvideo/videolist.h
45 45 GenericTree *addDirNode(GenericTree *where_to_add, 46 46 const QString& dname); 47 47 GenericTree *addFileNode(GenericTree *where_to_add, 48 const QString& fname, int id);48 const QString& fname, const QString& title, int id); 49 49 50 50 bool m_ListUnknown; 51 51 bool m_LoadMetaData; -
mythvideo/mythvideo/videolist.cpp
221 221 file_string.remove(0, prefix.length()); 222 222 if (flatlist) 223 223 { 224 video_tree_root->addNode( file_string, count, true);224 video_tree_root->addNode(myData->Title(), count, true); 225 225 nitems++; 226 226 } 227 227 else 228 228 { 229 where_to_add = addFileNode(where_to_add, file_string, count);229 where_to_add = addFileNode(where_to_add, file_string, myData->Title(), count); 230 230 } 231 231 metas.append(*myData); 232 232 delete myData; … … 336 336 } 337 337 338 338 Metadata *myData = new Metadata; 339 // See if we can find this filename in DB339 // See if we can/should find this filename in DB 340 340 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. 350 343 QString base_name = file_string.section("/", -1); 351 344 myData->setTitle(base_name.section(".", 0, -2)); 352 353 345 } 354 346 355 347 metas.append(*myData); … … 358 350 { 359 351 file_string.remove(0, prefix.length()); 360 352 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); 362 354 } 363 355 else { 364 video_tree_root->addNode( file_string, i, true);356 video_tree_root->addNode(myData->Title(), i, true); 365 357 nitems++; 366 358 } 367 359 } … … 423 415 } 424 416 425 417 GenericTree *VideoList::addFileNode(GenericTree *where_to_add, 426 const QString& fname, int index)418 const QString& fname, const QString& title, int index) 427 419 { 428 420 int a_counter = 0; 429 421 GenericTree *sub_node; … … 434 426 { 435 427 if(a_counter + 1 >= (int) list.count()) // video 436 428 { 437 QString title = (*an_it); 438 sub_node = where_to_add->addNode(title.section(".",0,-2), 429 sub_node = where_to_add->addNode(title, 439 430 index, true); 440 431 sub_node->setAttribute(0, ORDER_ITEM); 441 432 sub_node->setOrderingIndex(0);