[rygel] media-export: Remove custom virtual folders
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Remove custom virtual folders
- Date: Sat, 14 Aug 2010 23:32:41 +0000 (UTC)
commit 4f96d2e87428ad8d9622d40e465435bbef8f1cb1
Author: Jens Georg <mail jensge org>
Date: Sat Aug 14 11:41:55 2010 +0300
media-export: Remove custom virtual folders
User-defined virtual folders are not not supported anymore
data/rygel-default.conf | 9 -----
data/rygel-maemo.conf | 9 -----
.../rygel-media-export-query-container.vala | 37 --------------------
.../rygel-media-export-root-container.vala | 31 ----------------
4 files changed, 0 insertions(+), 86 deletions(-)
---
diff --git a/data/rygel-default.conf b/data/rygel-default.conf
index 093f2d1..286b15d 100644
--- a/data/rygel-default.conf
+++ b/data/rygel-default.conf
@@ -69,15 +69,6 @@ title= REALNAME@'s media
# List of URIs to export; if list is empty, the XDG media directries are
# exported.
uris=
-# Virtual folders. Using this option you can create hierarchies based on
-# differnt metadata values. Syntax for each hierarch is the following:
-#
-# TITLE=KEY1,VALUE1[,KEY2,VALUE2,..]
-#
-# When '?' is used as value, it will introduce extra hierarchy that is composed
-# of a folder for each unique value of the metadata in question.
-#
-virtual-folders=Artists=upnp:artist,?,upnp:album,?;Albums=upnp:album,?,upnp:artist,?
include-filter=.mp3;.oga;.ogv;.ogg;.mkv;.avi;.mp4;.mpeg;.mpg;.ts;.flac;.jpeg;.jpg;.wav;.wma;.wmv;.asf
extract-metadata=true
diff --git a/data/rygel-maemo.conf b/data/rygel-maemo.conf
index e3d72f1..044e8f2 100644
--- a/data/rygel-maemo.conf
+++ b/data/rygel-maemo.conf
@@ -69,15 +69,6 @@ title= HOSTNAME@
# List of URIs to export; if list is empty, the XDG media directries are
# exported.
uris=
-# Virtual folders. Using this option you can create hierarchies based on
-# differnt metadata values. Syntax for each hierarch is the following:
-#
-# TITLE=KEY1,VALUE1[,KEY2,VALUE2,..]
-#
-# When '?' is used as value, it will introduce extra hierarchy that is composed
-# of a folder for each unique value of the metadata in question.
-#
-virtual-folders=Artists=upnp:artist,?,upnp:album,?;Albums=upnp:album,?,upnp:artist,?
include-filter=.mp3;.oga;.ogv;.ogg;.mkv;.avi;.mp4;.mpeg;.mpg;.ts;.flac;.jpeg;.jpg;.wav;.wma;.wmv;.asf
extract-metadata=true
diff --git a/src/plugins/media-export/rygel-media-export-query-container.vala b/src/plugins/media-export/rygel-media-export-query-container.vala
index a0c5281..ff23774 100644
--- a/src/plugins/media-export/rygel-media-export-query-container.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container.vala
@@ -29,43 +29,6 @@ internal class Rygel.MediaExport.QueryContainer : DBContainer {
public string plaintext_id;
private string pattern = "";
- /**
- * Simple check for validity of user-supplied virtual folder id
- *
- * @param id to check
- * @return true, if id passes, false otherwise
- */
- public static bool validate_virtual_id (string id) {
- if (! id.has_prefix (PREFIX)) {
-
- return false;
- }
-
- var args = id.split(",");
-
- if ((args.length % 2) != 0) {
- warning (_("ID does not contain pairs"));
-
- return false;
- }
-
- for (int i = 0; i < args.length; i += 2) {
- if (args[i] == "" || args[i + 1] == "") {
- warning (_("Empty part not allowed in virtual ID"));
-
- return false;
- }
-
- if (args[i] == "?") {
- warning (_("Placeholder can only be on second place"));
-
- return false;
- }
- }
-
- return true;
- }
-
public QueryContainer (MediaCache media_db,
string id,
string name = "") {
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index a907306..adb3f4d 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -308,37 +308,6 @@ public class Rygel.MediaExport.RootContainer : Rygel.MediaExport.DBContainer {
}
}
- try {
- var config = MetaConfig.get_default ();
- var virtual_containers = config.get_string_list (
- "MediaExport",
- "virtual-folders");
- foreach (var container in virtual_containers) {
- var info = container.split ("=");
- var id = QueryContainer.PREFIX + info[1];
- if (!QueryContainer.validate_virtual_id (id)) {
- warning (_("%s is not a valid virtual ID"), id);
-
- continue;
- }
- QueryContainer.register_id (ref id);
-
- var virtual_container = new QueryContainer (
- this.media_db,
- id,
- info[0]);
- virtual_container.parent = this;
- try {
- this.media_db.save_container (virtual_container);
- } catch (Error error) { } // do nothing
-
- ids.remove (id);
- }
- } catch (Error error) {
- warning (_("Got error while trying to find virtual folders: %s"),
- error.message);
- }
-
foreach (var id in ids) {
debug (_("ID %s no longer in config, deleting..."), id);
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]