[banshee: 51/61] [InternetArchive] Lots of good tweaks
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee: 51/61] [InternetArchive] Lots of good tweaks
- Date: Tue, 3 Nov 2009 06:32:07 +0000 (UTC)
commit 88bdb46258bcdbf130669b4622b78a719e554210
Author: Gabriel Burt <gabriel burt gmail com>
Date: Fri Oct 16 15:39:55 2009 -0700
[InternetArchive] Lots of good tweaks
.../Banshee.InternetArchive/DetailsView.cs | 8 ++++--
.../Banshee.InternetArchive/HeaderFilters.cs | 8 ++++--
.../Banshee.InternetArchive/SearchSource.cs | 6 ++--
.../Banshee.InternetArchive/SearchView.cs | 4 +-
.../InternetArchive/Search.cs | 22 +------------------
5 files changed, 17 insertions(+), 31 deletions(-)
---
diff --git a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/DetailsView.cs b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/DetailsView.cs
index fa60156..80cb299 100644
--- a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/DetailsView.cs
+++ b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/DetailsView.cs
@@ -178,7 +178,9 @@ namespace Banshee.InternetArchive
// Reviews
Expander reviews = null;
if (details.NumReviews > 0) {
- reviews = CreateExpander (Catalog.GetString ("Reviews"));
+ reviews = CreateExpander (String.Format (Catalog.GetPluralString (
+ "Reviews ({0} reviewer)", "Reviews ({0} reviewers)", details.NumReviews), details.NumReviews
+ ));
var reviews_box = new VBox () { Spacing = 6 };
reviews.Child = reviews_box;
@@ -361,9 +363,9 @@ namespace Banshee.InternetArchive
file_list.SetModel (files_model);
// Order the formats according to the preferences
- string format_order = String.Format ("{0}{1}{2}", SearchSource.VideoTypes.Get (), SearchSource.AudioTypes.Get (), SearchSource.TextTypes.Get ()).ToLower ();
+ string format_order = String.Format (", {0}, {1}, {2},", SearchSource.VideoTypes.Get (), SearchSource.AudioTypes.Get (), SearchSource.TextTypes.Get ()).ToLower ();
- var sorted_formats = formats.Select (f => new { Format = f, Order = format_order.IndexOf (f.ToLower ()) })
+ var sorted_formats = formats.Select (f => new { Format = f, Order = Math.Max (format_order.IndexOf (", " + f.ToLower () + ","), format_order.IndexOf (f.ToLower ())) })
.OrderBy (o => o.Order == -1 ? Int32.MaxValue : o.Order);
var format_list = ComboBox.NewText ();
diff --git a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HeaderFilters.cs b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HeaderFilters.cs
index 9a3d7a4..a7b7bc8 100644
--- a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HeaderFilters.cs
+++ b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/HeaderFilters.cs
@@ -70,6 +70,8 @@ namespace Banshee.InternetArchive
var combo = media_type_combo = new ComboBox ();
combo.Model = store;
+ store.AppendValues (null, Catalog.GetString ("All"));
+
foreach (var mediatype in IA.MediaType.Options.OrderBy (t => t.Name)) {
if (mediatype.Id != "software") {
var iter = store.AppendValues (mediatype, mediatype.Name);
@@ -165,7 +167,7 @@ namespace Banshee.InternetArchive
{
source.Search.Sorts.Clear ();
- string [] sorts = { "downloads desc", "week asc", "avg_rating desc", "year asc", "addeddate desc" };
+ string [] sorts = { "downloads desc", "week desc", "avg_rating desc", "year asc", "addeddate desc" };
source.Search.Sorts.Add (new IA.Sort () { Id = sorts[sort_combo.Active] });
// And if the above sort value is the same for two items, sort by creator then by title
@@ -175,10 +177,10 @@ namespace Banshee.InternetArchive
TreeIter iter;
if (media_type_combo.GetActiveIter (out iter)) {
var media_type = media_type_store.GetValue (iter, 0) as IA.FieldValue;
- string query = media_type.ToString ();
+ string query = media_type != null ? media_type.ToString () + " AND " : "";
// Remove medialess 'collection' results
- query += " AND -mediatype:collection";
+ query += "-mediatype:collection";
if (!String.IsNullOrEmpty (search_entry.Query)) {
query += String.Format (" AND {0}", search_entry.Query);
diff --git a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchSource.cs b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchSource.cs
index a25d13f..c37ab6c 100644
--- a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchSource.cs
+++ b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchSource.cs
@@ -88,7 +88,7 @@ namespace Banshee.InternetArchive
InstallPreferences ();
- search = new IA.Search ();
+ search = new IA.Search () { NumResults = 100 };
//Properties.SetStringList ("Icon.Name", "video-x-generic", "video", "source-library");
@@ -297,12 +297,12 @@ namespace Banshee.InternetArchive
public static readonly SchemaEntry<string> VideoTypes = new SchemaEntry<string> (
"plugins.internetarchive", "video_types",
- "Ogg Video, *Ogg*, 512Kb MPEG4, MPEG2",
+ "Ogg Video, 512Kb MPEG4, MPEG2, h.264 MPEG4, DivX, Quicktime, MPEG1",
"Ordered list of preferred mediatypes for video items", null);
public static readonly SchemaEntry<string> TextTypes = new SchemaEntry<string> (
"plugins.internetarchive", "text_types",
- "Text PDF, Standard LuraTech PDF, *PDF*, ZIP, Text, Hypertext",
+ "Text PDF, Standard LuraTech PDF, Grayscale LuraTech PDF, ZIP, Text, Hypertext",
"Ordered list of preferred mediatypes for text items", null);
#endregion
diff --git a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchView.cs b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchView.cs
index 85a69ef..b910b58 100644
--- a/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchView.cs
+++ b/src/Extensions/Banshee.InternetArchive/Banshee.InternetArchive/SearchView.cs
@@ -126,9 +126,9 @@ namespace Banshee.InternetArchive
var cols = new SortableColumn [] {
Create ("Title", Catalog.GetString ("Title"), 0.9, true, new ColumnCellText (null, true)),
Create ("Creator", Catalog.GetString ("Creator"), 0.15, true, new ColumnCellText (null, true)),
- Create ("Producer", Catalog.GetString ("Producer"), 0.15, false, new ColumnCellText (null, true)),
+ Create ("Publisher", Catalog.GetString ("Publisher"), 0.15, false, new ColumnCellText (null, true)),
Create ("Description", Catalog.GetString ("Description"), 0.35, false, new ColumnCellText (null, true)),
- Create ("AvgRatingInt", Catalog.GetString ("Rating"), 0.15, true, new ColumnCellRating (null, true) { ReadOnly = true }),
+ Create ("AvgRatingInt",Catalog.GetString ("Rating"), 0.15, true, new ColumnCellRating (null, true) { ReadOnly = true }),
Create ("Year", Catalog.GetString ("Year"), 0.15, true, new ColumnCellPositiveInt (null, true, 4, 4) { CultureFormatted = false }),
Create ("Downloads", Catalog.GetString ("Downloads"), 0.15, true, new ColumnCellPositiveInt (null, true, 2, 5)),
Create ("Format", Catalog.GetString ("Formats"), 0.15, false, new ColumnCellText (null, true)),
diff --git a/src/Extensions/Banshee.InternetArchive/InternetArchive/Search.cs b/src/Extensions/Banshee.InternetArchive/InternetArchive/Search.cs
index a843e3b..6983f5c 100644
--- a/src/Extensions/Banshee.InternetArchive/InternetArchive/Search.cs
+++ b/src/Extensions/Banshee.InternetArchive/InternetArchive/Search.cs
@@ -36,11 +36,11 @@ namespace InternetArchive
{
List<Sort> sorts = new List<Sort> ();
List<Field> result_fields = new List<Field> ();
- int NumResults;
public IList<Field> ReturnFields { get { return result_fields; } }
public IList<Sort> Sorts { get { return sorts; } }
public string Query { get; set; }
+ public int NumResults { get; set; }
public int Page { get; set; }
static Search () {
@@ -51,25 +51,7 @@ namespace InternetArchive
public Search ()
{
NumResults = 50;
-
- result_fields.AddRange (new Field [] {
- Field.AvgRating,
- Field.Creator,
- Field.Date,
- Field.Description,
- Field.Downloads,
- Field.Format,
- Field.Identifier,
- Field.Language,
- Field.LicenseUrl,
- Field.License,
- Field.MediaType,
- Field.NumReviews,
- Field.Publisher,
- Field.Title,
- Field.Year
- });
-
+ result_fields.AddRange (Field.Fields);
sorts.Add (new Sort () { Id = "avg_rating desc" });
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]