Ticket #3742: VideoPrefix.diff
File VideoPrefix.diff, 5.7 KB (added by , 17 years ago) |
---|
-
mythvideo/mythvideo/metadata.cpp
433 433 if (m_userrating < -10.0 || m_userrating >= 10.0) 434 434 m_userrating = 0.0; 435 435 m_length = query.value(6).toInt(); 436 m_filename = QString::fromUtf8(query.value(7).toString());436 m_filename = gVideoFilesPrefix + QString::fromUtf8(query.value(7).toString()); 437 437 m_showlevel = query.value(8).toInt(); 438 m_coverfile = QString::fromUtf8(query.value(9).toString());438 m_coverfile = gVideoArtworkPrefix + QString::fromUtf8(query.value(9).toString()); 439 439 m_inetref = QString::fromUtf8(query.value(10).toString()); 440 440 m_childID = query.value(11).toUInt(); 441 441 m_browse = query.value(12).toBool(); … … 510 510 query.bindValue(":YEAR", m_year); 511 511 query.bindValue(":USERRATING", m_userrating); 512 512 query.bindValue(":LENGTH", m_length); 513 query.bindValue(":FILENAME", m_filename. utf8());513 query.bindValue(":FILENAME", m_filename.mid(gVideoFilesPrefix.length()).utf8()); 514 514 query.bindValue(":SHOWLEVEL", m_showlevel); 515 query.bindValue(":COVERFILE", m_coverfile. utf8());515 query.bindValue(":COVERFILE", m_coverfile.mid(gVideoArtworkPrefix.length()).utf8()); 516 516 query.bindValue(":INETREF", m_inetref.utf8()); 517 517 query.bindValue(":BROWSE", m_browse); 518 518 -
mythvideo/mythvideo/globalsettings.cpp
214 214 return gc; 215 215 } 216 216 217 static HostLineEdit *VideoFilesPrefix() 218 { 219 HostLineEdit *gc = new HostLineEdit("VideoFilesPrefix"); 220 gc->setLabel(QObject::tr("Local prefix for the videos directories")); 221 gc->setValue(""); 222 gc->setHelpText(QObject::tr("A path to be prepended to the video startup " 223 "and artwork dirs. Added during scanning and " 224 "removed for database updates it enables local " 225 "management of mountpoints.")); 226 return gc; 227 }; 228 217 229 HostLineEdit *VideoArtworkDirectory() 218 230 { 219 231 HostLineEdit *gc = new HostLineEdit("VideoArtworkDir"); … … 225 237 return gc; 226 238 } 227 239 240 static HostLineEdit *VideoArtworkPrefix() 241 { 242 HostLineEdit *gc = new HostLineEdit("VideoArtworkPrefix"); 243 gc->setLabel(QObject::tr("Local prefix for the artwork directory")); 244 gc->setValue(""); 245 gc->setHelpText(QObject::tr("A path to be prepended to the video artwork " 246 "dirs Added during scanning and removed for " 247 "database updates it enables local management " 248 "of mountpoints.")); 249 return gc; 250 }; 251 228 252 //Player Settings 229 253 230 254 HostLineEdit *VideoDefaultPlayer() … … 552 576 general->setLabel(QObject::tr("General Settings (%1/%2)") 553 577 .arg(1).arg(pages)); 554 578 general->addChild(VideoStartupDirectory()); 579 general->addChild(VideoFilesPrefix()); 555 580 general->addChild(VideoArtworkDirectory()); 581 general->addChild(VideoArtworkPrefix()); 556 582 general->addChild(VideoDefaultParentalLevel()); 557 583 general->addChild(VideoAdminPassword()); 558 584 general->addChild(VideoAggressivePC()); -
mythvideo/mythvideo/globals.cpp
30 30 #else 31 31 const QString DEFAULT_VIDEOSTARTUP_DIR = "/share/Movies/dvd"; 32 32 #endif 33 34 QString gVideoFilesPrefix; 35 QString gVideoArtworkPrefix; -
mythvideo/mythvideo/main.cpp
567 567 568 568 setupKeys(); 569 569 570 gVideoFilesPrefix = gContext->GetSetting("VideoFilesPrefix"); 571 gVideoArtworkPrefix = gContext->GetSetting("VideoArtworkPrefix"); 572 570 573 return 0; 571 574 } 572 575 -
mythvideo/mythvideo/videolist.cpp
10 10 #include "metadatalistmanager.h" 11 11 #include "dbaccess.h" 12 12 13 #include "globals.h" 13 14 #include "quicksp.h" 14 15 #include "dirscan.h" 15 16 #include "videoutils.h" … … 815 816 prefix_to_node_map ptnm; 816 817 817 818 QStringList dirs = GetVideoDirs(); 818 QString test_prefix( dirs[0]);819 QString test_prefix(gVideoFilesPrefix + dirs[0]); 819 820 820 821 meta_dir_node *video_root = &m_metadata_tree; 821 822 if (dirs.size() == 1) … … 907 908 { 908 909 node_paths.push_back( 909 910 node_to_path_list::value_type(path_to_node_name(*iter), 910 *iter));911 gVideoFilesPrefix + *iter)); 911 912 } 912 913 } 913 914 else 914 915 { 915 916 node_paths.push_back( 916 node_to_path_list::value_type(QObject::tr("videos"), dirs[0])); 917 node_to_path_list::value_type(QObject::tr("videos"), 918 gVideoFilesPrefix + dirs[0])); 917 919 } 918 920 919 921 // -
mythvideo/mythvideo/globals.h
25 25 26 26 extern const QString DEFAULT_VIDEOSTARTUP_DIR; 27 27 28 extern QString gVideoFilesPrefix; 29 extern QString gVideoArtworkPrefix; 30 28 31 #endif // GLOBALS_H_