[banshee] --query-X option sometimes returned an error (bgo#591291)
- From: Alexander Kojevnikov <alexk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] --query-X option sometimes returned an error (bgo#591291)
- Date: Wed, 12 Aug 2009 22:57:16 +0000 (UTC)
commit e59396eba55eac5b8755587efc3059a7c4e43e8d
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date: Thu Aug 13 08:52:17 2009 +1000
--query-X option sometimes returned an error (bgo#591291)
If the currently playing song had and empty value, querying for it
produced - Error: 'X' field unknown.
This commit returns an empty string if the currently playing song
has no value set for the field being queried.
src/Clients/Halie/Halie/Client.cs | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/src/Clients/Halie/Halie/Client.cs b/src/Clients/Halie/Halie/Client.cs
index 8b1a071..47b110d 100644
--- a/src/Clients/Halie/Halie/Client.cs
+++ b/src/Clients/Halie/Halie/Client.cs
@@ -204,17 +204,26 @@ namespace Halie
case "can-seek":
DisplayTrackField ("can-seek", player.CanSeek);
break;
- default:
+ case "URI":
+ case "artist":
+ case "album":
+ case "name":
+ case "length":
+ case "track-number":
+ case "track-count":
+ case "disc":
+ case "year":
+ case "rating":
+ case "score":
+ case "bit-rate":
if (track == null) {
Error ("not playing");
break;
}
-
- if (track.ContainsKey (query)) {
- DisplayTrackField (query, track[query]);
- } else {
- Error ("'{0}' field unknown", query);
- }
+ DisplayTrackField (query, track.ContainsKey (query) ? track[query] : "");
+ break;
+ default:
+ Error ("'{0}' field unknown", query);
break;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]