Kodi - Auto update/clean libraries
|
Posts: 403
Threads: 26
Joined: Aug 2015
Reputation:
39
[Not Solved]
Nov 02, 2015, 01:57 PM
Hi
Is there a way to auto update the library every x hours or every day?
Today I have to manually update the library through the menu.
I want a way to clean and update the library every xx hours or xx days.
I'm running the lastest Kodi on Raspberry Pi2 (Jessie)
Regards
Manne
Posts: 403
Threads: 26
Joined: Aug 2015
Reputation:
39
[Not Solved]
Nov 02, 2015, 03:15 PM
I found this:
https://superrepo.org/kodi/addon/service...utoupdate/
Will check it out later and report.
Also found that you could rund cron job/watchdog but many people had some troubles with it.
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Not Solved]
Nov 02, 2015, 04:16 PM
I am pretty sure updating and cleaning are separate functions. I know you can update the library if you have the Kodi web server enabled (I have a python script for it somewhere). Cleaning is a more thorough function that removes files from the database that are no longer there.
Python would probably the be easiest way to do this
executebuiltin(CleanLibrary(database))
http://kodi.wiki/view/List_of_Built_In_Functions
http://mirrors.kodi.tv/docs/python-docs/.../xbmc.html
Here is a sample, make sure to pip install simplejson
Code:
#!/usr/bin/env python
#HTPCGuides.com script to clean library
settings = {
'hostname': '127.0.0.1',
'port': '99',
'username': 'HTPCGuides',
'password': 'password'
}
http_address = 'http://%s:%s/jsonrpc' % (settings['hostname'], settings['port'])
username = settings['username']
password = settings['password']
try:
import json
except ImportError:
import simplejson as json
import urllib2, base64
class XBMCJSON:
def __init__(self, server):
self.server = server
self.version = '2.0'
def __call__(self, **kwargs):
method = '.'.join(map(str, self.n))
self.n = []
return XBMCJSON.__dict__['Request'](self, method, kwargs)
def __getattr__(self,name):
if not self.__dict__.has_key('n'):
self.n=[]
self.n.append(name)
return self
def Request(self, method, kwargs):
data = [{}]
data[0]['method'] = method
data[0]['params'] = kwargs
data[0]['jsonrpc'] = self.version
data[0]['id'] = 1
data = json.JSONEncoder().encode(data)
content_length = len(data)
content = {
'Content-Type': 'application/json',
'Content-Length': content_length,
}
request = urllib2.Request(self.server, data, content)
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
request.add_header("Authorization", "Basic %s" % base64string)
f = urllib2.urlopen(request)
response = f.read()
f.close()
response = json.JSONDecoder().decode(response)
try:
return response[0]['result']
except:
return response[0]['error']
xbmc = XBMCJSON(http_address)
xbmc.executebuiltin(CleanLibrary(database))
Posts: 38
Threads: 11
Joined: Jul 2015
Reputation:
3
[Not Solved]
Nov 02, 2015, 05:59 PM
Posts: 403
Threads: 26
Joined: Aug 2015
Reputation:
39
[Not Solved]
Nov 02, 2015, 08:42 PM
(Nov 02, 2015, 05:59 PM)lorddark462 Wrote: I use this addon for auto update and auto clean.
http://kodi.wiki/view/Add-on:XBMC_Library_Auto_Update
Thanks, just installed it and configured it to clean the library every 6h on refresh.
Will see how it does the job.
Posts: 215
Threads: 25
Joined: Aug 2015
Reputation:
26
[Not Solved]
Dec 23, 2015, 04:03 PM
With XBMC Library Auto Update you can also add a cron job so you can have it run when you are not using your media center. Mine always start once a day at 18.00 h because then I'm not using my htpc for sure.
You could also use Yatse or Kore on android, there it's just one tap in the menu.
That McNugget sauce. I want that Mulan McNugget sauce, Morty. That's my series arc, Morty! If it takes nine seasons!
Posts: 403
Threads: 26
Joined: Aug 2015
Reputation:
39
[Not Solved]
Dec 23, 2015, 04:20 PM
(Dec 23, 2015, 04:03 PM)Yveske Wrote: With XBMC Library Auto Update you can also add a cron job so you can have it run when you are not using your media center. Mine always start once a day at 18.00 h because then I'm not using my htpc for sure.
You could also use Yatse or Kore on android, there it's just one tap in the menu.
I'm using it and one called Watchdog Auto update library. Works good as far as I can see.
Posts: 215
Threads: 25
Joined: Aug 2015
Reputation:
26
[Not Solved]
Dec 23, 2015, 11:16 PM
I used to use Watchdog as well but replaced it by letting Sonarr and CouchPotato connect to Kodi and start an update after downloading something.
That McNugget sauce. I want that Mulan McNugget sauce, Morty. That's my series arc, Morty! If it takes nine seasons!
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Not Solved]
Dec 25, 2015, 05:45 PM
@Yveske this is what I do too and it seems much faster for updating. Depending on how often you delete items from your collection or add hard drives/change locations cleaning regularly can be a good idea.
Posts: 403
Threads: 26
Joined: Aug 2015
Reputation:
39
[Not Solved]
Dec 25, 2015, 06:23 PM
Sonarr or couchpotato doesn't update kodi. It's kodi who looks at the library and updates. The two add-ons for kodi does the job for me. When I remove a file from my collection the add-ons in kodi removes the file from the library collection.
Sent from my SM-G925F using Tapatalk
|
|
Recent Posts
|
Split Tunnel Docker Containers
nakanda Mar 25, 2023, 11:08 AM
|
online mobile slots
nakanda Mar 15, 2023, 10:23 AM
|
datebest.net - visit website and win smartphone!
nakanda Mar 03, 2023, 04:02 AM
|
Split working but deluge Connection timed out
jonescelinaa Feb 24, 2023, 04:45 AM
|
Can't get split tunnel from article to work
jonesPhedra Feb 24, 2023, 04:30 AM
|
Latest unread posts | Unanswered posts |
|