Req Recorded TV Sort Order Options and TV Thumbnail Display for TV Show Folders
#1
Hello,

Not sure if this has been requested, but I was wondering if you could add these feature requests:

- Recorded TV sort order: Ability to change the sort order. Its always sorted by latest recordings, but I'd like the option to be able to sort shows alphabetically as well

- Recorded TV thumbnail display for TV Show folders - similar to how WMC behaves, it would look nicer if you took a thumbnail from the most recent recording in each show folder, and used that thumbnail for display when you are looking at TV show directories. I hope that description makes sense?

Thanks
Reply
#2
I have just started to look into the sorting myself.

I use mythtv and there are multiple options I like to use to sort things depending on the type of show it is.
It would seem like this info is missing from the PVR_RECORDING type and changing that would need to update the PVR_API_VERSION.
Here is a diff with just trying to find the code spots myself.
I am not sure if there is another clever way to do this without needing to update the API Version.
Code:
Changes in HEAD
    Modified   xbmc/addons/include/xbmc_pvr_types.h
diff --git a/xbmc/addons/include/xbmc_pvr_types.h b/xbmc/addons/include/xbmc_pvr_types.h
index 94e1a59..faee0df 100644
--- a/xbmc/addons/include/xbmc_pvr_types.h
+++ b/xbmc/addons/include/xbmc_pvr_types.h
@@ -294,6 +294,11 @@ extern "C" {
     int    iGenreSubType;                                 /*!< @brief (optional) genre sub type */
     int    iPlayCount;                                    /*!< @brief (optional) play count of this recording on the client */
     int    iLastPlayedPosition;                           /*!< @brief (optional) last played position of this recording on the client */
+#ifdef NEW_SORTABLES
+    time_t originalAirTime;
+    char strSeasEp[20];
+    char strProgamID[120];
+#endif
   } ATTRIBUTE_PACKED PVR_RECORDING;

   /*!
    Modified   xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
diff --git a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
index 1c7a697..8f5410e 100644
--- a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
@@ -139,6 +139,7 @@ void CGUIWindowPVRRecordings::GetContextButtons(int itemNumber, CContextButtons
   }
   buttons.Add(CONTEXT_BUTTON_SORTBY_NAME, 103);       /* sort by name */
   buttons.Add(CONTEXT_BUTTON_SORTBY_DATE, 104);       /* sort by date */
+  //Add more sort options?

   if (pItem->HasPVRRecordingInfoTag() &&
       g_PVRClients->HasMenuHooks(pItem->GetPVRRecordingInfoTag()->m_iClientId, PVR_MENUHOOK_RECORDING))
Reply
#3
There seems to be the setting to change things but it doesn't seem to work for me on the latest git code and cmyth addon.
Looking at things more I still can't wrap my head around all the different classes on how the sort code works. I haven't been able to find docs to help describe how the classes are related.
It would seem CGUIWindowPVRCommon::m_iSort.. isn't connected to the CGUIMediaWindow and CGUIViewStateWindow values.
I was able to get this backtrace on things where the SortByDate button was pressed, but the sortBy var being passed into the sort still has the SortByLabel value.

(gdb) backtrace
#0 SortUtils::Sort (sortDescription=..., items=...) at SortUtils.cpp:705
#1 0x0000000001120132 in CFileItemList::Sort (this=0x27dc5f0, sortDescription=...) at FileItem.cpp:1957
#2 0x000000000111fe5a in CFileItemList::Sort (this=0x27dc5f0, sortBy=SortByLabel, sortOrder=SortOrderDescending, sortAttributes=SortAttributeIgnoreArticle) at FileItem.cpp:1923
#3 0x00000000010d04a5 in CGUIMediaWindow::FormatAndSort (this=0x27dbea0, items=...) at GUIMediaWindow.cpp:637
#4 0x00000000010d515d in CGUIMediaWindow::UpdateFileList (this=0x27dbea0) at GUIMediaWindow.cpp:1399
#5 0x00000000010cedeb in CGUIMediaWindow::OnMessage (this=0x27dbea0, message=...) at GUIMediaWindow.cpp:480
#6 0x00000000014264a5 in PVR::CGUIWindowPVR::OnMessage (this=0x27dbea0, message=...) at GUIWindowPVR.cpp:185
#7 0x0000000000c254c6 in PVR::CGUIWindowPVRCommon::OnContextButtonSortByDate (this=0x7fffa4003590, item=0x3787100, button=CONTEXT_BUTTON_SORTBY_DATE) at GUIWindowPVRCommon.cpp:239


===
I started to hack in CGUIViewStatePVR::CGUIViewStatePVR(), and this change gets things to sort by Date, but the button to switch still doesn't work.
Does anyone know why there is a + 100 - ActiveView?
Code:
}

-  LoadViewState(items.GetPath(), ActiveView == PVR_WINDOW_UNKNOWN ? WINDOW_PVR : WINDOW_PVR + 100 - ActiveView );
+  CLog::Log(LOGERROR, "%s Doing LV", __FUNCTION__ );
+  SetViewAsControl(DEFAULT_VIEW_LIST);
+  LoadViewState(items.GetPath(), PVR_WINDOW_RECORDINGS);
+  //LoadViewState(items.GetPath(), ActiveView == PVR_WINDOW_UNKNOWN ? WINDOW_PVR : WINDOW_PVR + 100 - ActiveView );
}

Looking at something like CGUIViewStateWindowVideoFiles as a reference things are very different, but I have no idea why. I would think that is more the model to follow, but I am not sure what the PVR quirks would be on how things should be different.
Should we have a single const CViewState *viewState = CViewStateSettings::Get().Get("pvr");? Or does the "pvr" need to change depending on the activeview?
Reply

Logout Mark Read Team Forum Stats Members Help
Recorded TV Sort Order Options and TV Thumbnail Display for TV Show Folders2