this breaks the network hub search because of #1893
This commit is contained in:
fgerlits 2006-10-26 11:14:41 +00:00
parent 199809e6df
commit 3e6875326f
4 changed files with 37 additions and 4 deletions

View File

@ -2897,6 +2897,13 @@ WebStorageClient :: createPlayable(XmlRpcValue data)
Ptr<const Glib::ustring>::Ref creator(new const Glib::ustring(std::string(
data["creator"] )));
checkStruct("private:createPlayable",
data,
"source",
XmlRpcValue::TypeString);
Ptr<const Glib::ustring>::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

View File

@ -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<Glib::ustring>::Ref
source = playable->getMetadata("dc:source");
row[modelColumns.sourceColumn]
= source ? Glib::Markup::escape_text(*source)
: "";
Ptr<time_duration>::Ref length = playable->getPlaylength();
row[modelColumns.lengthColumn] = length ?
*TimeConversion::timeDurationToHhMmSsString(length) : "";

View File

@ -345,6 +345,11 @@ class SearchWindow : public GuiWindow
*/
Gtk::TreeModelColumn<Glib::ustring> creatorColumn;
/**
* The column for the album of the audio clip or playlist.
*/
Gtk::TreeModelColumn<Glib::ustring> 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);
}
};

View File

@ -205,6 +205,7 @@ root:table
typeColumnLabel:string { "Type" }
titleColumnLabel:string { "Title" }
creatorColumnLabel:string { "Creator" }
sourceColumnLabel:string { "Album" }
lengthColumnLabel:string { "Length" }
allStringForBrowse { "--- all ---" }