Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added nfo file entry <playtitle>

        0	play longest title (not yet implemented)
        N play title N (or playlist NNNNN.mpls - leading zeros are uneccessary)
        100000 or absent play menu or disc start
    
In the case of DVDs the dvdplayer plays just one pgc (normally an episode or movie)
and then quits
  • Loading branch information...
commit 6133837a2ecc0d2da0b9372d2f643286f9516a7b 1 parent 6399b48
@dragonflight authored
View
3  xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -581,6 +581,9 @@ bool CDVDPlayer::OpenInputStream()
else
m_pInputStream->SetFileItem(m_item);
+ if(title == 100000 && (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD) || m_pInputStream->IsStreamType(DVDSTREAM_TYPE_BLURAY)) && m_item.HasVideoInfoTag())
+ title = m_item.GetVideoInfoTag()->m_iPlayTitle;
+
if( title >= 100000 ) // match filename.titnnn.iso
{
int t, n=-1, len;
View
1  xbmc/utils/DatabaseUtils.h
@@ -112,6 +112,7 @@ typedef enum {
FieldSubtitleLanguage,
FieldProductionCode,
FieldTag,
+ FieldPlayTitle,
FieldChannelName,
FieldInstruments,
FieldBiography,
View
31 xbmc/video/VideoDatabase.cpp
@@ -136,7 +136,7 @@ bool CVideoDatabase::CreateTables()
column.Format(",c%02d text", i);
columns += column;
}
- columns += ", idSet integer)";
+ columns += ", idSet integer, playTitle integer )";
m_pDS->exec(columns.c_str());
m_pDS->exec("CREATE UNIQUE INDEX ix_movie_file_1 ON movie (idFile, idMovie)");
m_pDS->exec("CREATE UNIQUE INDEX ix_movie_file_2 ON movie (idMovie, idFile)");
@@ -205,7 +205,7 @@ bool CVideoDatabase::CreateTables()
columns += column;
}
- columns += ", idShow integer)";
+ columns += ", idShow integer, playTitle integer)";
m_pDS->exec(columns.c_str());
m_pDS->exec("CREATE UNIQUE INDEX ix_episode_file_1 on episode (idEpisode, idFile)");
m_pDS->exec("CREATE UNIQUE INDEX id_episode_file_2 on episode (idFile, idEpisode)");
@@ -2012,6 +2012,7 @@ int CVideoDatabase::SetDetailsForMovie(const CStdString& strFilenameAndPath, con
sql += PrepareSQL(", idSet = %i", idSet);
else
sql += ", idSet = NULL";
+ sql += PrepareSQL(", playTitle = %i", details.m_iPlayTitle);
sql += PrepareSQL(" where idMovie=%i", idMovie);
m_pDS->exec(sql.c_str());
CommitTransaction();
@@ -2170,6 +2171,7 @@ int CVideoDatabase::SetDetailsForEpisode(const CStdString& strFilenameAndPath, c
// and insert the new row
CStdString sql = "update episode set " + GetValueString(details, VIDEODB_ID_EPISODE_MIN, VIDEODB_ID_EPISODE_MAX, DbEpisodeOffsets);
+ sql += PrepareSQL(", playTitle = %i", details.m_iPlayTitle);
sql += PrepareSQL(" where idEpisode=%i", idEpisode);
m_pDS->exec(sql.c_str());
CommitTransaction();
@@ -3203,10 +3205,11 @@ CVideoInfoTag CVideoDatabase::GetDetailsForMovie(const dbiplus::sql_record* cons
details.m_playCount = record->at(VIDEODB_DETAILS_MOVIE_PLAYCOUNT).get_asInt();
details.m_lastPlayed.SetFromDBDateTime(record->at(VIDEODB_DETAILS_MOVIE_LASTPLAYED).get_asString());
details.m_dateAdded.SetFromDBDateTime(record->at(VIDEODB_DETAILS_MOVIE_DATEADDED).get_asString());
+ details.m_iPlayTitle = record->at(VIDEODB_DETAILS_MOVIE_PLAY_TITLE).get_asInt();
+
details.m_resumePoint.timeInSeconds = record->at(VIDEODB_DETAILS_MOVIE_RESUME_TIME).get_asInt();
details.m_resumePoint.totalTimeInSeconds = record->at(VIDEODB_DETAILS_MOVIE_TOTAL_TIME).get_asInt();
details.m_resumePoint.type = CBookmark::RESUME;
-
movieTime += XbmcThreads::SystemClockMillis() - time; time = XbmcThreads::SystemClockMillis();
if (needsCast)
@@ -3320,6 +3323,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(const dbiplus::sql_record* co
details.m_iIdShow = record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_ID).get_asInt();
details.m_strShowPath = record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_PATH).get_asString();
details.m_iIdSeason = record->at(VIDEODB_DETAILS_EPISODE_SEASON_ID).get_asInt();
+ details.m_iPlayTitle = record->at(VIDEODB_DETAILS_EPISODE_PLAY_TITLE).get_asInt();
details.m_resumePoint.timeInSeconds = record->at(VIDEODB_DETAILS_EPISODE_RESUME_TIME).get_asInt();
details.m_resumePoint.totalTimeInSeconds = record->at(VIDEODB_DETAILS_EPISODE_TOTAL_TIME).get_asInt();
@@ -4181,6 +4185,27 @@ bool CVideoDatabase::UpdateOldVersion(int iVersion)
}
}
}
+ if (iVersion < 73)
+ { // add idSet to movie table
+ m_pDS->exec("ALTER TABLE movie ADD playTitle integer");
+ m_pDS->query("SELECT idMovie FROM movie");
+ while (!m_pDS->eof())
+ {
+ int idMovie = m_pDS->fv(0).get_asInt();
+ CStdString sql = PrepareSQL("UPDATE movie SET playTitle=100000 WHERE idMovie = %d", idMovie);
+ m_pDS2->exec(sql.c_str());
+ m_pDS->next();
+ }
+ m_pDS->exec("ALTER TABLE episode ADD playTitle integer");
+ m_pDS->query("SELECT idEpisode FROM episode");
+ while (!m_pDS->eof())
+ {
+ int idEpisode = m_pDS->fv(0).get_asInt();
+ CStdString update = PrepareSQL("UPDATE episode SET playTitle=100000 WHERE idEpisode=%d", idEpisode);
+ m_pDS2->exec(update.c_str());
+ m_pDS->next();
+ }
+ }
// always recreate the view after any table change
CreateViews();
return true;
View
48 xbmc/video/VideoDatabase.h
@@ -70,30 +70,32 @@ namespace VIDEO
#define VIDEODB_MAX_COLUMNS 24
#define VIDEODB_DETAILS_FILEID 1
-#define VIDEODB_DETAILS_MOVIE_SET_ID VIDEODB_MAX_COLUMNS + 2
-#define VIDEODB_DETAILS_MOVIE_SET_NAME VIDEODB_MAX_COLUMNS + 3
-#define VIDEODB_DETAILS_MOVIE_FILE VIDEODB_MAX_COLUMNS + 4
-#define VIDEODB_DETAILS_MOVIE_PATH VIDEODB_MAX_COLUMNS + 5
-#define VIDEODB_DETAILS_MOVIE_PLAYCOUNT VIDEODB_MAX_COLUMNS + 6
-#define VIDEODB_DETAILS_MOVIE_LASTPLAYED VIDEODB_MAX_COLUMNS + 7
-#define VIDEODB_DETAILS_MOVIE_DATEADDED VIDEODB_MAX_COLUMNS + 8
-#define VIDEODB_DETAILS_MOVIE_RESUME_TIME VIDEODB_MAX_COLUMNS + 9
-#define VIDEODB_DETAILS_MOVIE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 10
+#define VIDEODB_DETAILS_MOVIE_SET_ID VIDEODB_MAX_COLUMNS + 2
+#define VIDEODB_DETAILS_MOVIE_PLAY_TITLE VIDEODB_MAX_COLUMNS + 3
+#define VIDEODB_DETAILS_MOVIE_SET_NAME VIDEODB_MAX_COLUMNS + 4
+#define VIDEODB_DETAILS_MOVIE_FILE VIDEODB_MAX_COLUMNS + 5
+#define VIDEODB_DETAILS_MOVIE_PATH VIDEODB_MAX_COLUMNS + 6
+#define VIDEODB_DETAILS_MOVIE_PLAYCOUNT VIDEODB_MAX_COLUMNS + 7
+#define VIDEODB_DETAILS_MOVIE_LASTPLAYED VIDEODB_MAX_COLUMNS + 8
+#define VIDEODB_DETAILS_MOVIE_DATEADDED VIDEODB_MAX_COLUMNS + 9
+#define VIDEODB_DETAILS_MOVIE_RESUME_TIME VIDEODB_MAX_COLUMNS + 10
+#define VIDEODB_DETAILS_MOVIE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 11
#define VIDEODB_DETAILS_EPISODE_TVSHOW_ID VIDEODB_MAX_COLUMNS + 2
-#define VIDEODB_DETAILS_EPISODE_FILE VIDEODB_MAX_COLUMNS + 3
-#define VIDEODB_DETAILS_EPISODE_PATH VIDEODB_MAX_COLUMNS + 4
-#define VIDEODB_DETAILS_EPISODE_PLAYCOUNT VIDEODB_MAX_COLUMNS + 5
-#define VIDEODB_DETAILS_EPISODE_LASTPLAYED VIDEODB_MAX_COLUMNS + 6
-#define VIDEODB_DETAILS_EPISODE_DATEADDED VIDEODB_MAX_COLUMNS + 7
-#define VIDEODB_DETAILS_EPISODE_TVSHOW_NAME VIDEODB_MAX_COLUMNS + 8
-#define VIDEODB_DETAILS_EPISODE_TVSHOW_STUDIO VIDEODB_MAX_COLUMNS + 9
-#define VIDEODB_DETAILS_EPISODE_TVSHOW_AIRED VIDEODB_MAX_COLUMNS + 10
-#define VIDEODB_DETAILS_EPISODE_TVSHOW_MPAA VIDEODB_MAX_COLUMNS + 11
-#define VIDEODB_DETAILS_EPISODE_TVSHOW_PATH VIDEODB_MAX_COLUMNS + 12
-#define VIDEODB_DETAILS_EPISODE_RESUME_TIME VIDEODB_MAX_COLUMNS + 13
-#define VIDEODB_DETAILS_EPISODE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 14
-#define VIDEODB_DETAILS_EPISODE_SEASON_ID VIDEODB_MAX_COLUMNS + 15
+#define VIDEODB_DETAILS_EPISODE_PLAY_TITLE VIDEODB_MAX_COLUMNS + 3
+#define VIDEODB_DETAILS_EPISODE_FILE VIDEODB_MAX_COLUMNS + 4
+#define VIDEODB_DETAILS_EPISODE_PATH VIDEODB_MAX_COLUMNS + 5
+#define VIDEODB_DETAILS_EPISODE_PLAYCOUNT VIDEODB_MAX_COLUMNS + 6
+#define VIDEODB_DETAILS_EPISODE_LASTPLAYED VIDEODB_MAX_COLUMNS + 7
+#define VIDEODB_DETAILS_EPISODE_DATEADDED VIDEODB_MAX_COLUMNS + 8
+#define VIDEODB_DETAILS_EPISODE_TVSHOW_NAME VIDEODB_MAX_COLUMNS + 9
+#define VIDEODB_DETAILS_EPISODE_TVSHOW_STUDIO VIDEODB_MAX_COLUMNS + 10
+#define VIDEODB_DETAILS_EPISODE_TVSHOW_AIRED VIDEODB_MAX_COLUMNS + 11
+#define VIDEODB_DETAILS_EPISODE_TVSHOW_MPAA VIDEODB_MAX_COLUMNS + 12
+#define VIDEODB_DETAILS_EPISODE_TVSHOW_PATH VIDEODB_MAX_COLUMNS + 13
+#define VIDEODB_DETAILS_EPISODE_RESUME_TIME VIDEODB_MAX_COLUMNS + 14
+#define VIDEODB_DETAILS_EPISODE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 15
+#define VIDEODB_DETAILS_EPISODE_SEASON_ID VIDEODB_MAX_COLUMNS + 16
#define VIDEODB_DETAILS_TVSHOW_PATH VIDEODB_MAX_COLUMNS + 1
#define VIDEODB_DETAILS_TVSHOW_DATEADDED VIDEODB_MAX_COLUMNS + 2
@@ -804,7 +806,7 @@ class CVideoDatabase : public CDatabase
*/
bool LookupByFolders(const CStdString &path, bool shows = false);
- virtual int GetMinVersion() const { return 72; };
+ virtual int GetMinVersion() const { return 73; };
virtual int GetExportVersion() const { return 1; };
const char *GetBaseDBName() const { return "MyVideos"; };
View
10 xbmc/video/VideoInfoTag.cpp
@@ -85,6 +85,7 @@ void CVideoInfoTag::Reset()
m_streamDetails.Reset();
m_playCount = 0;
m_fEpBookmark = 0;
+ m_iPlayTitle = 100000;
m_basePath.clear();
m_parentPathID = -1;
m_resumePoint.Reset();
@@ -115,6 +116,8 @@ bool CVideoInfoTag::Save(TiXmlNode *node, const CStdString &tag, bool savePathIn
XMLUtils::SetString(movie, "sorttitle", m_strSortTitle);
XMLUtils::SetFloat(movie, "rating", m_fRating);
XMLUtils::SetFloat(movie, "epbookmark", m_fEpBookmark);
+ if( m_iPlayTitle < 100000 )
+ XMLUtils::SetInt(movie, "playtitle", m_iPlayTitle);
XMLUtils::SetInt(movie, "year", m_iYear);
XMLUtils::SetInt(movie, "top250", m_iTop250);
if (tag == "episodedetails" || tag == "tvshow")
@@ -336,6 +339,7 @@ void CVideoInfoTag::Archive(CArchive& ar)
ar << m_dateAdded.GetAsDBDateTime();
ar << m_type;
ar << m_iIdSeason;
+ ar << m_iPlayTitle;
}
else
{
@@ -417,6 +421,7 @@ void CVideoInfoTag::Archive(CArchive& ar)
m_dateAdded.SetFromDBDateTime(dateAdded);
ar >> m_type;
ar >> m_iIdSeason;
+ ar >> m_iPlayTitle;
}
}
@@ -484,6 +489,7 @@ void CVideoInfoTag::Serialize(CVariant& value) const
value["dateadded"] = m_dateAdded.IsValid() ? m_dateAdded.GetAsDBDateTime() : StringUtils::EmptyString;
value["type"] = m_type;
value["seasonid"] = m_iIdSeason;
+ value["playtitle"] = m_iPlayTitle;
}
void CVideoInfoTag::ToSortable(SortItem& sortable)
@@ -523,6 +529,7 @@ void CVideoInfoTag::ToSortable(SortItem& sortable)
sortable[FieldId] = m_iDbId;
sortable[FieldTrackNumber] = m_iTrack;
sortable[FieldTag] = m_tags;
+ sortable[FieldPlayTitle] = m_iPlayTitle;
if (m_streamDetails.HasItems() && m_streamDetails.GetVideoDuration() > 0)
sortable[FieldTime] = m_streamDetails.GetVideoDuration();
@@ -564,6 +571,9 @@ void CVideoInfoTag::ParseNative(const TiXmlElement* movie, bool prioritise)
XMLUtils::GetString(movie, "sorttitle", m_strSortTitle);
XMLUtils::GetFloat(movie, "rating", m_fRating);
XMLUtils::GetFloat(movie, "epbookmark", m_fEpBookmark);
+ CStdString temp;
+ if( !XMLUtils::GetInt(movie, "playtitle", m_iPlayTitle) )
+ m_iPlayTitle = 100000;
int max_value = 10;
const TiXmlElement* rElement = movie->FirstChildElement("rating");
if (rElement && (rElement->QueryIntAttribute("max", &max_value) == TIXML_SUCCESS) && max_value>=1)
View
2  xbmc/video/VideoInfoTag.h
@@ -128,6 +128,8 @@ class CVideoInfoTag : public IArchivable, public ISerializable, public ISortable
int m_iTrack;
float m_fRating;
float m_fEpBookmark;
+ int m_iPlayTitle; // title to play for optical media 100000 play menu,
+ //0 play longest, n only play title n (playlist nnnnn.mpls) then stop, -n play title n-1
int m_iBookmarkId;
int m_iIdShow;
int m_iIdSeason;
View
2  xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -1047,7 +1047,7 @@ bool CGUIWindowVideoBase::ShowPlaySelection(CFileItemPtr& item)
if (item->m_lStartOffset)
return true;
- if (item->IsBDFile())
+ if (item->IsBDFile() && !(item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_iPlayTitle != 100000))
{
CStdString root = URIUtils::GetParentPath(item->GetPath());
URIUtils::RemoveSlashAtEnd(root);
Please sign in to comment.
Something went wrong with that request. Please try again.