From df4832bf6f73d9587de603ad8a151853a962ba84 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 19 Nov 2008 03:17:56 +0000 Subject: Change Media_RSS_Controller so that it does not extend REST_Controller, since it doesn't refer to a fixed resource or collection of resources. Fix some minor bugs in the code so that we can actually generate a feed. It looks pretty cool! Improved pagination links, but didn't actually test them. --- core/config/routes.php | 1 + core/models/item.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/config/routes.php b/core/config/routes.php index 4da97654..0e2aa887 100644 --- a/core/config/routes.php +++ b/core/config/routes.php @@ -22,6 +22,7 @@ // The problem is that we're routing all requests to /{controllername} to Rest_Controller, // even requests to controllers that do not implement Rest_Controller. $config['^welcome$'] = 'welcome'; +$config['^media_rss/feed/(\d+)'] = 'media_rss/feed/$1'; // REST configuration // Any resource requests (eg: album/1 or comment/3) get dispatched to the REST diff --git a/core/models/item.php b/core/models/item.php index 0b576d2c..950be499 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -176,7 +176,7 @@ class Item_Model extends ORM_MPTT { return "id}-{$real_column}\">" . "{$this->$real_column}"; } else if ($column == "mime_type") { - if ($this->is_album() || ($mime_type = file::mime()) === false) { + if ($this->is_album() || ($mime_type = file::mime($this->file_path())) === false) { $mime_type = "application/unknown"; } return $mime_type; -- cgit v1.2.3