summaryrefslogtreecommitdiffstats
path: root/js/service/FeedResource.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/service/FeedResource.js')
-rw-r--r--js/service/FeedResource.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/service/FeedResource.js b/js/service/FeedResource.js
index 7eb87b564..bf890f74e 100644
--- a/js/service/FeedResource.js
+++ b/js/service/FeedResource.js
@@ -13,6 +13,7 @@ app.factory('FeedResource', function (Resource, $http, BASE_URL, $q) {
var FeedResource = function ($http, BASE_URL, $q) {
Resource.call(this, $http, BASE_URL, 'url');
this.ids = {};
+ this.locations = {};
this.unreadCount = 0;
this.folderUnreadCount = {};
this.folderIds = {};
@@ -33,6 +34,7 @@ app.factory('FeedResource', function (Resource, $http, BASE_URL, $q) {
this.folderUnreadCount = {};
this.folderIds = {};
this.ids = {};
+ this.locations = {};
};
FeedResource.prototype.updateUnreadCache = function () {
@@ -70,6 +72,9 @@ app.factory('FeedResource', function (Resource, $http, BASE_URL, $q) {
if (value.id !== undefined) {
this.ids[value.id] = this.hashMap[value.url];
}
+ if (value.location !== undefined) {
+ this.locations[value.location] = this.hashMap[value.url];
+ }
};
@@ -141,6 +146,10 @@ app.factory('FeedResource', function (Resource, $http, BASE_URL, $q) {
};
+ FeedResource.prototype.getByLocation = function (location) {
+ return this.locations[location];
+ };
+
FeedResource.prototype.rename = function (id, title) {
return this.http({
method: 'POST',
@@ -252,6 +261,10 @@ app.factory('FeedResource', function (Resource, $http, BASE_URL, $q) {
delete this.ids[feed.id];
}
+ if (feed !== undefined && feed.location) {
+ delete this.locations[feed.location];
+ }
+
Resource.prototype.delete.call(this, url);
if (updateCache !== false) {