Hello!
I am a happy user of NEWS, and sometimes some feeds just chage the url, and I have to delete them and add them again with a new url.
Is there a way to edit urls of the feeds? With right-click would be great, next to the "rename" option for example.
Cheers!
This. Otherwise you lose the history of your feed.
The only way to identify a feed is through it's URL. It's technically impossible to change the feed URL since that would make it another feed.
Seems unlikely that a feed does not have an id in the database...
If I follow what you are saying, the feature request cannot be implemented because it requires being implemented? If the current way to identify a feed is by its url, then the fix is to add another way to identify the feed.
Updating existing feeds is not a crazy feature so it should imo be supported in news. If it's too hard to refactor the code to use an id where needed, the existing items can be updated so their url point to the updated feed.
At least leave the issue open.
Seems unlikely that a feed does not have an id in the database...
Heh, I thought I'd trust the maintainer, but yeah, feeds are not identified by their url at all.
The feedID is a hash of the URL when you look in the data structure instead of the API. It can be changed but that would means that a lot of operations that get done on the URL will break. Just tell the author to stop changing the URL of the RSS feed, your RSS aggregator shouldn't have to work around it.
The feedID is a hash of the URL when you look in the data structure instead of the API.
It is not: GET /index.php/apps/news/items?id=44&limit=40&oldestFirst=false&search=&showAll=true&type=0
The feedID is a hash of the URL when you look in the data structure instead of the API.
It is not:
GET /index.php/apps/news/items?id=44&limit=40&oldestFirst=false&search=&showAll=true&type=0
That's the API. https://github.com/nextcloud/news/blob/master/lib/Service/FeedService.php#L108 this is the data structure.
Yes, in which the url hash is only used to check if a feed already exists for that url.
The item is linked to the feed using the feed id.
Yes, in which the url hash is only used to check if a feed already exists for that url.
That seems like a pretty useful feature.
If you want to make a pull request changing all this and making sure no existing features break be my guest, but you don't need to have an open issue for that so I'm keeping this closed.
This is completely beside the point. Having a hash of the feed's url doesn't disallow updating said url in any way.
PATCH /.../news/feed/:id
{ "url": "new url" }
The method already exists, it just needs to support a new field. Sure the url_hash field will need to be recomputed and maybe we will need to hit the database to check if there isn't another feed with that updated hash.
I'm not sure why you keep focussing on that url hash which is not used in any way related to this feature request.
For the ones that actually need this, if you have access to the database, you can use this method (I don't think sqlite has a md5 function so beware):
nextcloud=> select
id, url, link, location, url_hash, md5(url), url_hash = md5(url)
from oc_news_feeds
where url ilike '%grafana%';
-[ RECORD 1 ]--------------------------------
id | 47
url | https://grafana.com/blog/index.xml
link | https://grafana.com/blog/
location | https://grafana.com/blog/index.xml
url_hash | 02bc001ad71492850555fe4a260a8455
md5 | 02bc001ad71492850555fe4a260a8455
?column? | t
nextcloud=> update oc_news_feeds
set
url = 'https://grafana.com/blog/index.xml',
location = 'https://grafana.com/blog/index.xml',
link = 'https://grafana.com/blog/',
url_hash = md5('https://grafana.com/blog/index.xml')
where id = 47;
UPDATE 1
Thanks bendem: My national newspaper just changed it's feeds' url and was stuck to lose history by recreating a new feed. I updated the table directly like you suggested using phpmyadmin and it worked.
The solution proposed by SMillerDev asking them not to change their feed is not really a good one. It doesn't seem to bother him, but I guess they'll implement this when it happens to them.
Thanks again!
This should be reopened, the url_hash issue does not make it impossible since it only is used to check for duplicates.
Most helpful comment
For the ones that actually need this, if you have access to the database, you can use this method (I don't think sqlite has a md5 function so beware):