From 3e6875326f618bd779a7b73887554a002b174bf3 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Thu, 26 Oct 2006 11:14:41 +0000 Subject: [PATCH] fixing #1873; this breaks the network hub search because of #1893 --- .../storageClient/src/WebStorageClient.cxx | 21 +++++++++++++++++-- .../gLiveSupport/src/SearchWindow.cxx | 13 ++++++++++-- .../products/gLiveSupport/src/SearchWindow.h | 6 ++++++ .../src/products/gLiveSupport/var/root.txt | 1 + 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/campcaster/src/modules/storageClient/src/WebStorageClient.cxx b/campcaster/src/modules/storageClient/src/WebStorageClient.cxx index 80cab6768..07e10351c 100644 --- a/campcaster/src/modules/storageClient/src/WebStorageClient.cxx +++ b/campcaster/src/modules/storageClient/src/WebStorageClient.cxx @@ -2897,6 +2897,13 @@ WebStorageClient :: createPlayable(XmlRpcValue data) Ptr::Ref creator(new const Glib::ustring(std::string( data["creator"] ))); + checkStruct("private:createPlayable", + data, + "source", + XmlRpcValue::TypeString); + Ptr::Ref source(new const Glib::ustring(std::string( + data["source"] ))); + checkStruct("private:createPlayable", data, "length", @@ -2917,11 +2924,21 @@ WebStorageClient :: createPlayable(XmlRpcValue data) if (type == "audioclip") { playable.reset(new AudioClip(uniqueId, title, playlength)); - playable->setMetadata(creator, "dc:creator"); + if (*creator != "") { + playable->setMetadata(creator, "dc:creator"); + } + if (*source != "") { + playable->setMetadata(source, "dc:source"); + } } else if (type == "playlist") { playable.reset(new Playlist(uniqueId, title, playlength)); - playable->setMetadata(creator, "dc:creator"); + if (*creator != "") { + playable->setMetadata(creator, "dc:creator"); + } + if (*source != "") { + playable->setMetadata(source, "dc:source"); + } } else if (type == "webstream") { // TODO: handle this case diff --git a/campcaster/src/products/gLiveSupport/src/SearchWindow.cxx b/campcaster/src/products/gLiveSupport/src/SearchWindow.cxx index ae1ca8eb8..2a1bb2462 100644 --- a/campcaster/src/products/gLiveSupport/src/SearchWindow.cxx +++ b/campcaster/src/products/gLiveSupport/src/SearchWindow.cxx @@ -336,11 +336,14 @@ SearchWindow :: constructSearchResultsView(void) throw () modelColumns.typeColumn, 20); searchResultsTreeView->appendColumn( *getResourceUstring("titleColumnLabel"), - modelColumns.titleColumn, 360); + modelColumns.titleColumn, 320); searchResultsTreeView->appendColumn( *getResourceUstring("creatorColumnLabel"), - modelColumns.creatorColumn, 260); + modelColumns.creatorColumn, 200); searchResultsTreeView->appendColumn( + *getResourceUstring("sourceColumnLabel"), + modelColumns.sourceColumn, 150); + searchResultsTreeView->appendCenteredColumn( *getResourceUstring("lengthColumnLabel"), modelColumns.lengthColumn, 50); } catch (std::invalid_argument &e) { @@ -512,6 +515,12 @@ SearchWindow :: displaySearchResults( = creator ? Glib::Markup::escape_text(*creator) : ""; + Ptr::Ref + source = playable->getMetadata("dc:source"); + row[modelColumns.sourceColumn] + = source ? Glib::Markup::escape_text(*source) + : ""; + Ptr::Ref length = playable->getPlaylength(); row[modelColumns.lengthColumn] = length ? *TimeConversion::timeDurationToHhMmSsString(length) : ""; diff --git a/campcaster/src/products/gLiveSupport/src/SearchWindow.h b/campcaster/src/products/gLiveSupport/src/SearchWindow.h index 61f5595b3..ec443885d 100644 --- a/campcaster/src/products/gLiveSupport/src/SearchWindow.h +++ b/campcaster/src/products/gLiveSupport/src/SearchWindow.h @@ -345,6 +345,11 @@ class SearchWindow : public GuiWindow */ Gtk::TreeModelColumn creatorColumn; + /** + * The column for the album of the audio clip or playlist. + */ + Gtk::TreeModelColumn sourceColumn; + /** * The column for the length of the audio clip or playlist. */ @@ -358,6 +363,7 @@ class SearchWindow : public GuiWindow add(typeColumn); add(titleColumn); add(creatorColumn); + add(sourceColumn); add(lengthColumn); } }; diff --git a/campcaster/src/products/gLiveSupport/var/root.txt b/campcaster/src/products/gLiveSupport/var/root.txt index a56ffcf90..03e094b4b 100644 --- a/campcaster/src/products/gLiveSupport/var/root.txt +++ b/campcaster/src/products/gLiveSupport/var/root.txt @@ -205,6 +205,7 @@ root:table typeColumnLabel:string { "Type" } titleColumnLabel:string { "Title" } creatorColumnLabel:string { "Creator" } + sourceColumnLabel:string { "Album" } lengthColumnLabel:string { "Length" } allStringForBrowse { "--- all ---" }