Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Python] add "sorttitle" to listitem.setInfo() #1067

Merged
merged 1 commit into from

2 participants

@nuka1195

and the sort method SORT_METHOD_VIDEO_SORT_TITLE

useful for proper sorting by title when you highlight search results with [COLOR blue] so the [ does not affect sorting.

@nuka1195 nuka1195 [Python] add "sorttitle" to listitem.setInfo() and the sort method SO…
…RT_METHOD_VIDEO_SORT_TITLE

useful for proper sorting by title when you highlight search results with [COLOR blue] so the [ does not affect sorting.
b1cc3dd
@jmarshallnz
Owner

Looks fine - will pull in July window.

@jmarshallnz jmarshallnz was assigned
@jmarshallnz jmarshallnz merged commit 898cab7 into xbmc:master
@tru tru referenced this pull request from a commit in RasPlex/plex-home-theatre
@tru tru Kill cache when you have played a item from a cached server.
This might change stuff like view state and such.

Fixes #1067
ba9f579
@tru tru referenced this pull request from a commit in plexinc/plex-home-theater-public
@tru tru Kill cache when you have played a item from a cached server.
This might change stuff like view state and such.

Fixes #1067
ef7b035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 13, 2012
  1. @nuka1195

    [Python] add "sorttitle" to listitem.setInfo() and the sort method SO…

    nuka1195 authored
    …RT_METHOD_VIDEO_SORT_TITLE
    
    useful for proper sorting by title when you highlight search results with [COLOR blue] so the [ does not affect sorting.
This page is out of date. Refresh to see the latest.
View
9 xbmc/filesystem/PluginDirectory.cpp
@@ -321,6 +321,15 @@ void CPluginDirectory::AddSortMethod(int handle, SORT_METHOD sortMethod, const C
dir->m_listItems->AddSortMethod(SORT_METHOD_VIDEO_TITLE, 369, LABEL_MASKS("%T", label2Mask));
break;
}
+ case SORT_METHOD_VIDEO_SORT_TITLE:
+ case SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE:
+ {
+ if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
+ dir->m_listItems->AddSortMethod(SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE, 369, LABEL_MASKS("%T", label2Mask));
+ else
+ dir->m_listItems->AddSortMethod(SORT_METHOD_VIDEO_SORT_TITLE, 369, LABEL_MASKS("%T", label2Mask));
+ break;
+ }
case SORT_METHOD_MPAA_RATING:
{
dir->m_listItems->AddSortMethod(SORT_METHOD_MPAA_RATING, 563, LABEL_MASKS("%T", "%O"));
View
3  xbmc/interfaces/python/xbmcmodule/listitem.cpp
@@ -351,6 +351,7 @@ namespace PYXBMC
" plotoutline : string (Short Description)\n"
" title : string (Big Fan)\n"
" originaltitle : string (Big Fan)\n"
+ " sorttitle : string (Big Fan)\n"
" duration : string (3:18)\n"
" studio : string (Warner Bros.)\n"
" tagline : string (An awesome movie) - short description of movie\n"
@@ -504,6 +505,8 @@ namespace PYXBMC
self->item->GetVideoInfoTag()->m_strTitle = tmp;
else if (strcmpi(PyString_AsString(key), "originaltitle") == 0)
self->item->GetVideoInfoTag()->m_strOriginalTitle = tmp;
+ else if (strcmpi(PyString_AsString(key), "sorttitle") == 0)
+ self->item->GetVideoInfoTag()->m_strSortTitle = tmp;
else if (strcmpi(PyString_AsString(key), "duration") == 0)
self->item->GetVideoInfoTag()->m_strRuntime = tmp;
else if (strcmpi(PyString_AsString(key), "studio") == 0)
View
5 xbmc/interfaces/python/xbmcmodule/xbmcplugin.cpp
@@ -255,7 +255,8 @@ namespace PYXBMC
" applies to: SORT_METHOD_NONE, SORT_METHOD_UNSORTED, SORT_METHOD_VIDEO_TITLE,\n"
" SORT_METHOD_TRACKNUM, SORT_METHOD_FILE, SORT_METHOD_TITLE\n"
" SORT_METHOD_TITLE_IGNORE_THE, SORT_METHOD_LABEL\n"
- " SORT_METHOD_LABEL_IGNORE_THE\n"
+ " SORT_METHOD_LABEL_IGNORE_THE, SORT_METHOD_VIDEO_SORT_TITLE,\n"
+ " SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE\n"
"\n"
"*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n"
" Once you use a keyword, all following arguments require the keyword.\n"
@@ -623,6 +624,8 @@ namespace PYXBMC
PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_UNSORTED", SORT_METHOD_UNSORTED);
PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_BITRATE", SORT_METHOD_BITRATE);
PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_LISTENERS", SORT_METHOD_LISTENERS);
+ PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_VIDEO_SORT_TITLE", SORT_METHOD_VIDEO_SORT_TITLE);
+ PyModule_AddIntConstant(pXbmcPluginModule, (char*)"SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE", SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE);
}
}
Something went wrong with that request. Please try again.