Ticket #6346: seasonEpisodeSubtitle.diff
File seasonEpisodeSubtitle.diff, 17.2 KB (added by , 15 years ago) |
---|
-
mythvideo/mythvideo/metadatalistmanager.cpp
112 112 MSqlQuery query(MSqlQuery::InitCon()); 113 113 query.setForwardOnly(true); 114 114 const QString BaseMetadataQuery( 115 "SELECT title, director, plot, rating, year, userrating," 116 "length, filename, showlevel, coverfile, inetref, childid," 117 "browse, playcommand, category, intid, trailer, screenshot," 118 "banner, fanart, host FROM videometadata"); 115 "SELECT title, director, plot, rating, year, " 116 "userrating, length, filename, showlevel, " 117 "coverfile, inetref, childid, browse, playcommand, category, " 118 "intid, trailer, screenshot, banner, fanart, " 119 "subtitle, season, episode, host FROM videometadata"); 119 120 120 121 query.prepare(BaseMetadataQuery); 121 122 -
mythvideo/mythvideo/metadata.cpp
89 89 public: 90 90 MetadataImp(const QString &filename, const QString &trailer, const QString &coverfile, 91 91 const QString &screenshot, const QString &banner, const QString &fanart, 92 const QString &title, int year,92 const QString &title, const QString &subtitle, int year, 93 93 const QString &inetref, const QString &director, 94 94 const QString &plot, float userrating, 95 95 const QString &rating, int length, 96 int season, int episode, 96 97 int id, ParentalLevel::Level showlevel, int categoryID, 97 98 int childID, bool browse, 98 99 const QString &playcommand, const QString &category, … … 100 101 const country_list &countries, 101 102 const cast_list &cast, 102 103 const QString &host = "") : 103 m_title(title), 104 m_title(title), m_subtitle(subtitle), 104 105 m_inetref(inetref), m_director(director), m_plot(plot), 105 106 m_rating(rating), m_playcommand(playcommand), m_category(category), 106 107 m_genres(genres), m_countries(countries), m_cast(cast), 107 108 m_filename(filename), m_trailer(trailer), m_coverfile(coverfile), 108 109 m_screenshot(screenshot), m_banner(banner), m_fanart(fanart), 109 110 m_host(host), m_categoryID(categoryID), m_childID(childID), 110 m_year(year), m_length(length), m_showlevel(showlevel), 111 m_year(year), m_length(length), m_season(season), 112 m_episode(episode), m_showlevel(showlevel), 111 113 m_browse(browse), m_id(id), m_userrating(userrating) 112 114 { 113 115 VideoCategory::GetCategory().get(m_categoryID, m_category); … … 128 130 if (this != &rhs) 129 131 { 130 132 m_title = rhs.m_title; 133 m_subtitle = rhs.m_subtitle; 131 134 m_inetref = rhs.m_inetref; 132 135 m_director = rhs.m_director; 133 136 m_plot = rhs.m_plot; … … 148 151 m_childID = rhs.m_childID; 149 152 m_year = rhs.m_year; 150 153 m_length = rhs.m_length; 154 m_season = rhs.m_season; 155 m_episode = rhs.m_episode; 151 156 m_showlevel = rhs.m_showlevel; 152 157 m_browse = rhs.m_browse; 153 158 m_id = rhs.m_id; … … 180 185 m_title = title; 181 186 } 182 187 188 const QString &getSubtitle() const { return m_subtitle; } 189 void SetSubtitle(const QString &subtitle) { m_subtitle = subtitle; } 190 183 191 const QString &GetInetRef() const { return m_inetref; } 184 192 void SetInetRef(const QString &inetRef) { m_inetref = inetRef; } 185 193 … … 249 257 int GetLength() const { return m_length; } 250 258 void SetLength(int length) { m_length = length; } 251 259 260 int GetSeason() const { return m_season; } 261 void SetSeason(int season) { m_season = season; } 262 263 int GetEpisode() const { return m_episode; } 264 void SetEpisode(int episode) { m_episode = episode; } 265 252 266 ParentalLevel::Level GetShowLevel() const { return m_showlevel; } 253 267 void SetShowLevel(ParentalLevel::Level showLevel) 254 268 { … … 289 303 290 304 private: 291 305 QString m_title; 306 QString m_subtitle; 292 307 QString m_inetref; 293 308 QString m_director; 294 309 QString m_plot; … … 310 325 int m_childID; 311 326 int m_year; 312 327 int m_length; 328 int m_season; 329 int m_episode; 313 330 ParentalLevel::Level m_showlevel; 314 331 bool m_browse; 315 332 unsigned int m_id; // videometadata.intid … … 384 401 MetadataImp tmp(m_filename, VIDEO_TRAILER_DEFAULT, VIDEO_COVERFILE_DEFAULT, 385 402 VIDEO_SCREENSHOT_DEFAULT, VIDEO_BANNER_DEFAULT, 386 403 VIDEO_FANART_DEFAULT, Metadata::FilenameToTitle(m_filename), 387 VIDEO_ YEAR_DEFAULT, VIDEO_INETREF_DEFAULT,404 VIDEO_SUBTITLE_DEFAULT, VIDEO_YEAR_DEFAULT, VIDEO_INETREF_DEFAULT, 388 405 VIDEO_DIRECTOR_DEFAULT, VIDEO_PLOT_DEFAULT, 0.0, 389 VIDEO_RATING_DEFAULT, 0, m_id,406 VIDEO_RATING_DEFAULT, 0, 0, 0, m_id, 390 407 ParentalLevel::plLowest, 0, -1, true, "", "", 391 408 Metadata::genre_list(), Metadata::country_list(), 392 409 Metadata::cast_list(), m_host); … … 484 501 m_screenshot = query.value(17).toString(); 485 502 m_banner = query.value(18).toString(); 486 503 m_fanart = query.value(19).toString(); 487 m_host = query.value(20).toString(); 504 m_subtitle = query.value(20).toString(); 505 m_season = query.value(21).toInt(); 506 m_episode = query.value(22).toInt(); 507 m_host = query.value(23).toString(); 488 508 489 509 VideoCategory::GetCategory().get(m_categoryID, m_category); 490 510 … … 502 522 { 503 523 if (m_title.isEmpty()) 504 524 m_title = Metadata::FilenameToTitle(m_filename); 525 if (m_subtitle.isEmpty()) 526 m_subtitle = VIDEO_SUBTITLE_DEFAULT; 505 527 if (m_director.isEmpty()) 506 528 m_director = VIDEO_DIRECTOR_UNKNOWN; 507 529 if (m_plot.isEmpty()) … … 533 555 { 534 556 m_browse = gContext->GetNumSetting("VideoNewBrowsable", 1); 535 557 536 query.prepare("INSERT INTO videometadata (title, director,plot,"537 "rating,year,userrating,length, filename,showlevel,"538 " coverfile,inetref,browse,trailer,screenshot,banner,"539 "fanart,host) VALUES (:TITLE, : DIRECTOR, :PLOT, :RATING, "540 ": YEAR, :USERRATING, :LENGTH, :FILENAME, :SHOWLEVEL, "541 ": COVERFILE, :INETREF, :BROWSE, :TRAILER, :SCREENSHOT, "542 ": BANNER, :FANART, :HOST)");558 query.prepare("INSERT INTO videometadata (title,subtitle,director,plot," 559 "rating,year,userrating,length,season,episode,filename," 560 "showlevel,coverfile,inetref,browse,trailer,screenshot,banner," 561 "fanart,host) VALUES (:TITLE, :SUBTITLE, :DIRECTOR, :PLOT, " 562 ":RATING, :YEAR, :USERRATING, :LENGTH, :SEASON, :EPISODE, " 563 ":FILENAME, :SHOWLEVEL, :COVERFILE, :INETREF, :BROWSE, " 564 ":TRAILER, :SCREENSHOT, :BANNER, :FANART, :HOST)"); 543 565 } 544 566 else 545 567 { 546 query.prepare("UPDATE videometadata SET title = :TITLE, "568 query.prepare("UPDATE videometadata SET title = :TITLE, subtitle = :SUBTITLE, " 547 569 "director = :DIRECTOR, plot = :PLOT, rating= :RATING, " 548 570 "year = :YEAR, userrating = :USERRATING, " 549 "length = :LENGTH, filename = :FILENAME, trailer = :TRAILER, " 571 "length = :LENGTH, season = :SEASON, episode = :EPISODE, " 572 "filename = :FILENAME, trailer = :TRAILER, " 550 573 "showlevel = :SHOWLEVEL, coverfile = :COVERFILE, " 551 574 "screenshot = :SCREENSHOT, banner = :BANNER, fanart = :FANART, " 552 575 "inetref = :INETREF, browse = :BROWSE, host = :HOST, " … … 560 583 } 561 584 562 585 query.bindValue(":TITLE", m_title); 586 query.bindValue(":SUBTITLE", m_subtitle); 563 587 query.bindValue(":DIRECTOR", m_director); 564 588 query.bindValue(":PLOT", m_plot); 565 589 query.bindValue(":RATING", m_rating); 566 590 query.bindValue(":YEAR", m_year); 567 591 query.bindValue(":USERRATING", m_userrating); 568 592 query.bindValue(":LENGTH", m_length); 593 query.bindValue(":SEASON", m_season); 594 query.bindValue(":EPISODE", m_episode); 569 595 query.bindValue(":FILENAME", m_filename); 570 596 query.bindValue(":TRAILER", m_trailer); 571 597 query.bindValue(":SHOWLEVEL", m_showlevel); … … 829 855 return ret; 830 856 } 831 857 832 Metadata::Metadata(const QString &filename, const QString &trailer, 833 const QString &coverfile, const QString &screenshot, 834 const QString &banner, const QString &fanart, 835 const QString &title, int year,858 Metadata::Metadata(const QString &filename, const QString &trailer, 859 const QString &coverfile, const QString &screenshot, 860 const QString &banner, const QString &fanart, 861 const QString &title, const QString &subtitle, int year, 836 862 const QString &inetref, const QString &director, 837 863 const QString &plot, float userrating, 838 864 const QString &rating, int length, 865 int season, int episode, 839 866 int id, ParentalLevel::Level showlevel, int categoryID, 840 867 int childID, bool browse, 841 868 const QString &playcommand, const QString &category, … … 845 872 const QString &host) 846 873 { 847 874 m_imp = new MetadataImp(filename, trailer, coverfile, screenshot, banner, 848 fanart, title, year, inetref, director, plot,849 userrating, rating, length, id, showlevel,850 categoryID, childID, browse, playcommand, category,851 genres, countries, cast, host);875 fanart, title, subtitle, year, inetref, director, plot, 876 userrating, rating, length, season, episode, id, 877 showlevel, categoryID, childID, browse, playcommand, 878 category, genres, countries, cast, host); 852 879 } 853 880 854 881 Metadata::~Metadata() … … 911 938 m_imp->SetTitle(title); 912 939 } 913 940 941 const QString &Metadata::GetSubtitle() const 942 { 943 return m_imp->getSubtitle(); 944 } 945 946 void Metadata::SetSubtitle(const QString &subtitle) 947 { 948 m_imp->SetSubtitle(subtitle); 949 } 950 914 951 int Metadata::GetYear() const 915 952 { 916 953 return m_imp->getYear(); … … 981 1018 m_imp->SetLength(length); 982 1019 } 983 1020 1021 int Metadata::GetSeason() const 1022 { 1023 return m_imp->GetSeason(); 1024 } 1025 1026 void Metadata::SetSeason(int season) 1027 { 1028 m_imp->SetSeason(season); 1029 } 1030 1031 int Metadata::GetEpisode() const 1032 { 1033 return m_imp->GetEpisode(); 1034 } 1035 1036 void Metadata::SetEpisode(int episode) 1037 { 1038 m_imp->SetEpisode(episode); 1039 } 1040 984 1041 unsigned int Metadata::GetID() const 985 1042 { 986 1043 return m_imp->GetID(); -
mythvideo/mythvideo/dbcheck.cpp
38 38 const QString lastMythDVDDBVersion = "1002"; 39 39 const QString lastMythVideoVersion = "1010"; 40 40 41 const QString currentDatabaseVersion = "102 3";41 const QString currentDatabaseVersion = "1024"; 42 42 43 43 const QString OldMythVideoVersionName = "VideoDBSchemaVer"; 44 44 const QString OldMythDVDVersionName = "DVDDBSchemaVer"; … … 834 834 performActualUpdate(updates, "1023", dbver, MythVideoVersionName); 835 835 } 836 836 837 if (dbver == "1023") 838 { 839 QStringList updates; 840 updates += "ALTER TABLE videometadata ADD `subtitle` TEXT " 841 "NOT NULL AFTER `title`;"; 842 updates += "ALTER TABLE videometadata ADD `season` SMALLINT " 843 "UNSIGNED NOT NULL DEFAULT '0' AFTER `length`;"; 844 updates += "ALTER TABLE videometadata ADD `episode` SMALLINT " 845 "UNSIGNED NOT NULL AFTER `season`;"; 846 performActualUpdate(updates, "1024", dbver, MythVideoVersionName); 847 } 837 848 838 849 } 839 850 } -
mythvideo/mythvideo/videoutils.cpp
139 142 return QString("%1 minutes").arg(length); 140 143 } 141 144 145 QString GetDisplaySeason(int season) 146 { 147 return QString::number(season); 148 } 149 150 QString GetDisplayEpisode(int episode) 151 { 152 return QString::number(episode); 153 } 154 142 155 QString GetDisplayBrowse(bool browse) 143 156 { 144 157 return browse ? QObject::tr("Yes") : QObject::tr("No"); -
mythvideo/mythvideo/videodlg.cpp
1014 1014 1015 1015 tmp["filename"] = metadata->GetFilename(); 1016 1016 tmp["title"] = metadata->GetTitle(); 1017 tmp["subtitle"] = metadata->GetSubtitle(); 1017 1018 tmp["director"] = metadata->GetDirector(); 1018 1019 tmp["plot"] = metadata->GetPlot(); 1019 1020 tmp["genres"] = GetDisplayGenres(*metadata); … … 1023 1024 tmp["length"] = GetDisplayLength(metadata->GetLength()); 1024 1025 tmp["year"] = GetDisplayYear(metadata->GetYear()); 1025 1026 tmp["userrating"] = GetDisplayUserRating(metadata->GetUserRating()); 1027 tmp["season"] = GetDisplaySeason(metadata->GetSeason()); 1028 tmp["episode"] = GetDisplayEpisode(metadata->GetEpisode()); 1026 1029 1027 1030 tmp["userratingstate"] = 1028 1031 QString::number((int)(metadata->GetUserRating())); … … 1073 1076 h.handleText("player"); 1074 1077 h.handleText("filename"); 1075 1078 h.handleText("title"); 1079 h.handleText("subtitle"); 1076 1080 h.handleText("director"); 1077 1081 h.handleText("plot"); 1078 1082 h.handleText("genres"); … … 1080 1084 h.handleText("cast"); 1081 1085 h.handleText("rating"); 1082 1086 h.handleText("length"); 1087 h.handleText("season"); 1088 h.handleText("episode"); 1083 1089 h.handleText("year"); 1084 1090 h.handleText("userrating"); 1085 1091 -
mythvideo/mythvideo/videoscan.cpp
268 268 VIDEO_BANNER_DEFAULT, 269 269 VIDEO_FANART_DEFAULT, 270 270 Metadata::FilenameToTitle(p->first), 271 VIDEO_SUBTITLE_DEFAULT, 271 272 VIDEO_YEAR_DEFAULT, 272 273 VIDEO_INETREF_DEFAULT, VIDEO_DIRECTOR_DEFAULT, 273 274 VIDEO_PLOT_DEFAULT, 0.0, VIDEO_RATING_DEFAULT, 274 0, 0, ParentalLevel::plLowest);275 0, 0, 0, 0, ParentalLevel::plLowest); 275 276 276 277 VERBOSE(VB_GENERAL, QString("Adding : %1 : %2") 277 278 .arg(newFile.GetHost()).arg(newFile.GetFilename())); -
mythvideo/mythvideo/metadata.h
13 13 14 14 enum { VIDEO_YEAR_DEFAULT = 1895 }; 15 15 16 const QString VIDEO_SUBTITLE_DEFAULT = ""; 17 16 18 struct SortData; 17 19 18 20 class Metadata … … 55 57 const QString &banner = QString(), 56 58 const QString &fanart = QString(), 57 59 const QString &title = QString(), 60 const QString &subtitle = QString(), 58 61 int year = VIDEO_YEAR_DEFAULT, 59 62 const QString &inetref = QString(), 60 63 const QString &director = QString(), … … 62 65 float userrating = 0.0, 63 66 const QString &rating = QString(), 64 67 int length = 0, 68 int season = 0, 69 int episode = 0, 65 70 int id = 0, 66 71 ParentalLevel::Level showlevel = ParentalLevel::plLowest, 67 72 int categoryID = 0, … … 89 94 const QString &GetTitle() const; 90 95 void SetTitle(const QString& title); 91 96 97 const QString &GetSubtitle() const; 98 void SetSubtitle(const QString &subtitle); 99 92 100 int GetYear() const; 93 101 void SetYear(int year); 94 102 … … 110 118 int GetLength() const; 111 119 void SetLength(int length); 112 120 121 int GetSeason() const; 122 void SetSeason(int season); 123 124 int GetEpisode() const; 125 void SetEpisode(int episode); 126 113 127 unsigned int GetID() const; 114 128 void SetID(int id); 115 129 -
mythvideo/mythvideo/videoutils.h
33 33 34 34 QString GetDisplayUserRating(float userrating); 35 35 QString GetDisplayLength(int length); 36 QString GetDisplaySeason(int season); 37 QString GetDisplayEpisode(int episode); 36 38 QString GetDisplayBrowse(bool browse); 37 39 QString GetDisplayYear(int year); 38 40 QString GetDisplayRating(const QString &rating);