Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

make dateadded available to skins as ListItem.DateAdded and to python scripts (closes #12965) #936

Merged
merged 1 commit into from

4 participants

@Montellese
Owner

Title says it all. This adds the info label ListITem.DateAdded so that skins can display that value for videos and allows python scripts to set that value for video listitem objects. Closes http://trac.xbmc.org/ticket/12965.

This PR does not include the work needed in Confluence to actually make use of the value, probably best to let @Jezz_X do that :-)

@Montellese Montellese was assigned
@jmarshallnz
Owner

Looks good.

@Montellese Montellese merged commit aaa34eb into xbmc:master
@JezzX
Collaborator

This should not need anything added to the skin it should auto fill label2 with the date added value when sorted in that way the same way sorting by year and duration and that do

@Montellese
Owner

Ah right I didn't know about that. I'll take a look at it and push it in once I figured out how it works ;-)

@HitcherUK

Using today's Windows build instead of listing by the date added to the library it is in fact listing by the date the file was created.

@Montellese
Owner

Yes that feature has been added during the April merge window (so at least a month ago).

@HitcherUK

So if sorting by Date Added actually sorts by Date Created why isn't it labelled as such?

@Montellese
Owner

I interpret it as "date when the video was added to my collection/library" independent of XBMC.

@dalehamel dalehamel referenced this pull request from a commit in RasPlex/plex-home-theatre
@tru tru [AE/CA] Fix optical 3fps issue.
This was caused by a problem with dd-wav. When falling back on systems
that doesn’t provide a encoded stream it was erroneously advertising
the stream as Float instead of signed integers. We know open the output
as integers if we are falling back on encoded data.

Fixes #936
6bdafea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
8 xbmc/GUIInfoManager.cpp
@@ -490,7 +490,8 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB },
{ "originaltitle", LISTITEM_ORIGINALTITLE },
{ "lastplayed", LISTITEM_LASTPLAYED },
{ "playcount", LISTITEM_PLAYCOUNT },
- { "discnumber", LISTITEM_DISC_NUMBER }};
+ { "discnumber", LISTITEM_DISC_NUMBER },
+ { "dateadded", LISTITEM_DATE_ADDED }};
const infomap visualisation[] = {{ "locked", VISUALISATION_LOCKED },
{ "preset", VISUALISATION_PRESET },
@@ -4223,7 +4224,12 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, CStdSt
str.Format("%d", val);
return str;
}
+ break;
}
+ case LISTITEM_DATE_ADDED:
+ if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_dateAdded.IsValid())
+ return item->GetVideoInfoTag()->m_dateAdded.GetAsLocalizedDate();
+ break;
}
return "";
}
View
1  xbmc/GUIInfoManager.h
@@ -508,6 +508,7 @@ namespace INFO
#define LISTITEM_FILE_EXTENSION (LISTITEM_START + 75)
#define LISTITEM_IS_RESUMABLE (LISTITEM_START + 76)
#define LISTITEM_PERCENT_PLAYED (LISTITEM_START + 77)
+#define LISTITEM_DATE_ADDED (LISTITEM_START + 78)
#define LISTITEM_PROPERTY_START (LISTITEM_START + 200)
#define LISTITEM_PROPERTY_END (LISTITEM_PROPERTY_START + 1000)
View
3  xbmc/interfaces/python/xbmcmodule/listitem.cpp
@@ -366,6 +366,7 @@ namespace PYXBMC
" artist : list (['U2'])\n"
" votes : string (12345 votes)\n"
" trailer : string (/home/user/trailer.avi)\n"
+ " dateadded : string (%Y-%m-%d %h:%m:%s = 2009-04-05 23:16:04)\n"
"\n"
"Music Values:\n"
" tracknumber : integer (8)\n"
@@ -536,6 +537,8 @@ namespace PYXBMC
if (strlen(tmp) == 10)
self->item->m_dateTime.SetDate(atoi(tmp.Right(4).c_str()), atoi(tmp.Mid(3,4).c_str()), atoi(tmp.Left(2).c_str()));
}
+ else if (strcmpi(PyString_AsString(key), "dateadded") == 0)
+ self->item->GetVideoInfoTag()->m_dateAdded.SetFromDBDateTime(tmp);
}
}
else if (strcmpi(cType, "music") == 0)
Something went wrong with that request. Please try again.