Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Printable Version
+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Add-ons (/forumdisplay.php?fid=26)
+--- Thread: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db (/showthread.php?tid=80845)
- solexalex - 2010-12-28 02:27
The-Boxhead Wrote:First of all, when you add folders in your addon the browse systemI made it this way because to me, it looks 'normal' to get a path from the source that are already setted in the picture part of XBMC itself.
Furthermore, doing like I did, I'm sure that the source for my addon, are available for XBMC.
I may change this, but you have to convince me
If many of you wants to add path to scan for pictures in my addon, the same way we add source in the picture section of XBMC, just tell me and I'll do it. (or maybe another option in the settings)
- The-Boxhead - 2010-12-28 02:30
ok i think just getting the already added sources is the best way and
not the advanced browser since this may confuse non geek users, i agree
- fiveisalive - 2010-12-28 03:56
solexalex Wrote:I made it this way because to me, it looks 'normal' to get a path from the source that are already setted in the picture part of XBMC itself.
I would like to be able to add arbitrary directories to scan without having to add them in the default Pictures source, so the full dialog would be useful to me. In fact I consider this addon a full drop-in replacement for the default Pictures source, which I consider to be completely unusable in comparison (in fact I completely remove the default Pictures app and add MyPicsDB as Pictures using the customization features in the Aeon MQ2 skin).
To make this drop-in complete, you could either 1) emulate how "sources" are added to the default Pictures app (complete with a dialog that allows you to specify how each folder is updated/scanned, as per the current options), or 2) allow access to the full filesystem.
- fiveisalive - 2010-12-28 04:03
Delboy Wrote:Great add-on, picture library is definitely needed although XBMC developers obviously don't think so. Thank you very much for creating it.
Yep, works the same way with my Panasonic Lumix camera, it actually stores them as .MOV files right in the same DCIM subfolder, using the same filename stucture as well. As for metadata, it's a problem, but using mtime is probably the best compromise (I'm also on Linux). I don't think there's any metadata embedded in the .MOV file, but I don't know how to find out for sure.
- Delboy - 2010-12-28 13:29
solexalex Wrote:et voilà, I added the st_mtime as a date for videos. This will be available on next release.
So videos will be included at browse by date output in the next release? Can't wait to see that.
I have a suggestion for date choosing, hope it is not too complicated to implement. You can make an add-on setting (like you did for file extensions) to take it from mtime, atime, ctime or even file name or folder name where the file resides. For the last 2 options user has to be able to define the correct date format and you can ignore time (set it to 00:00) or take it from mtime.
I think this will be a big improvement for the database.
Keep up the good work, cheers.
Remote paths - human705 - 2010-12-28 20:57
I'm having a problem seen my remote path since the new release. Here is what I see in the log:
13:46:57 T:3916 M:2121875456 NOTICE: Traceback (most recent call last):
13:46:57 T:3916 M:2121875456 NOTICE: File "C:\Users\me\AppData\Roaming\XBMC\addons\plugin.image.mypicsdb\scanpath.py", line 194, in browse_folder
13:46:57 T:3916 M:2121875456 NOTICE: listdir = oslistdir(dirname)
13:46:57 T:3916 M:2121871360 NOTICE: WindowsError: [Errno 67] The network name cannot be found: '\\\\690WIN7\\xbmcuser:[email protected]\\Pictures-JPEG\\2005\\2005_01_18\\*.*'
13:46:57 T:3916 M:2121871360 NOTICE: MyPicsDB >> Error while trying to get directory content
13:46:57 T:3916 M:2121871360 NOTICE: MyPicsDB >> \\690WIN7\xbmcuser:[email protected]\Pictures-JPEG\2005\2005_01_18\
13:46:57 T:3916 M:2122706944 NOTICE: MyPicsDB >> This folder does not contain any picture :
13:46:57 T:3916 M:2122706944 NOTICE: MyPicsDB >> \\690WIN7\xbmcuser:[email protected]\Pictures-JPEG\2005\2005_01_18\
13:46:57 T:3916 M:2122706944 NOTICE: MyPicsDB >>
13:46:57 T:3916 M:2122706944 NOTICE: MyPicsDB >> scan the subfolders of :
13:46:57 T:3916 M:2122706944 NOTICE: MyPicsDB >> \\690WIN7\xbmcuser:[email protected]\Pictures-JPEG\2005\2005_01_18\
13:46:57 T:3916 M:2122682368 INFO: Scriptresult: Success
13:46:57 T:3916 M:2122657792 INFO: Python script stopped
13:46:57 T:3916 M:2122657792 DEBUG: Thread 3916 terminating
13:46:57 T:3140 M:2122739712 DEBUG: python thread 2 destructed
13:46:57 T:3140 M:2122735616 INFO: Loading skin file: DialogKaiToast.xml
13:46:57 T:3140 M:2121650176 DEBUG: ------ Window Init (DialogKaiToast.xml) ------
13:47:00 T:4100 M:2121068544 DEBUG: thread start, auto delete: 1
13:47:01 T:3140 M:2112835584 DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.image.mypicsdb/?method='recentpics'&period=''&value=''&viewmode='view'&action='showpics'&name='Pictures+recently+added')
13:47:01 T:3140 M:2112835584 DEBUG: ParentPath = [plugin://plugin.image.mypicsdb/?action='showhome'&viewmode='view']
13:47:01 T:5020 M:2112835584 DEBUG: XFILE::CPluginDirectory::StartScript - calling plugin My Pictures Database('plugin://plugin.image.mypicsdb/','0','?method='recentpics'&period=''&value=''&viewmode='view'&action='showpics'&name='Pictures+recently+added'')
13:47:01 T:5020 M:2112835584 INFO: initializing python engine.
13:47:01 T:5020 M:2112835584 DEBUG: new python thread created. id=4
13:47:01 T:5020 M:2112819200 DEBUG: XFILE::CPluginDirectory::WaitOnScriptResult - waiting on the My Pictures Database plugin...
13:47:01 T:720 M:2112811008 DEBUG: thread start, auto delete: 0
13:47:01 T:720 M:2112798720 DEBUG: Python thread: start processing
13:47:01 T:720 M:2112651264 DEBUG: msg: 'import site' failed; use -v for traceback
13:47:01 T:720 M:2112651264 NOTICE: -->Python Interpreter Initialized<--
13:47:01 T:720 M:2112651264 DEBUG: XBPyThread::Process - The source file to load is C:\Users\me\AppData\Roaming\XBMC\addons\plugin.image.mypicsdb\default.py
13:47:01 T:720 M:2112651264 DEBUG: XBPyThread::Process - Setting the Python path to C:\Users\me\AppData\Roaming\XBMC\addons\plugin.image.mypicsdb;C:\Users\me\AppData\Roaming\XBMC\addons\script.module.dialogaddonscan\lib;C:\Users\me\AppData\Roaming\XBMC\addons\script.module.simplejson\lib;C:\Users\me\AppData\Roaming\XBMC\addons\script.module.beautifulsoup\lib;C:\Program Files (x86)\XBMC\addons\script.module.pil\lib;C:\Program Files (x86)\XBMC\addons\script.module.pysqlite\lib;special://xbmc/system/python/DLLs;special://xbmc/system/python/Lib;special://xbmcbin/system/python/python24.zip;special://xbmc/system/python\DLLs;special://xbmc/system/python\lib;special://xbmc/system/python\lib\plat-win;special://xbmc/system/python\lib\lib-tk;C:\Program Files (x86)\XBMC
13:47:01 T:720 M:2112651264 DEBUG: XBPyThread::Process - Entering source directory C:\Users\me\AppData\Roaming\XBMC\addons\plugin.image.mypicsdb
13:47:01 T:720 M:2112647168 WARNING: msvcrt.dll: dll_fstati64 called, TODO: add 'int64 <-> long' type checking
13:47:02 T:720 M:2111787008 NOTICE: using pysqlite2
13:47:02 T:720 M:2111774720 NOTICE: MyPicturesDB plugin called :
13:47:02 T:720 M:2111774720 NOTICE: plugin://plugin.image.mypicsdb/?method='recentpics'&period=''&value=''&viewmode='view'&action='showpics'&name='Pictures+recently+added'
13:47:02 T:720 M:2111774720 NOTICE: --------------------
I know I can access the path because I can browse the source and see the pictures.
I'm using Windows 7 64-bit as the client and the share is located on another windows 7 64bit machine (the same ones i was using before). Let me know if you need any more info.
- fiveisalive - 2010-12-29 01:53
seems to add the movies (using SVN version from google code)! sometimes the date is off, but not by much, and that's because of the file date, so much can be done there (other than maually fixing them). however the date doesn't show up in the right column as it does for pics. also, is it easy to make thumbnails of the videos? when you view rthe directory in the regular video source, it does show a thumbnail, so maybe you can call some xbmc python function to get that?
network shares within MPD on OS/X - mhdebokx - 2010-12-30 23:06
I found something about the shares on OSX
Within XBMC I added a location name like ‘networkstorage’ with the following direction:
smb://userid: [email protected]/photo/2010/
When I add a path using the MPD add-on, I can select ‘networkstorage’ and I see all the maps/folders at that location. So I know for sure it is working at that moment.
When the scanning is started within MPD, the information stored in the MyPictures.db table ‘Rootpaths’ is being used. In the field ‘path’ a different value is stored:
\\userid: [email protected]\photo\2010\
I think this is the problem. OSX/Linux do have an different path-notation then Windows machines.
When I modify this value and do a rescan, then it will work!
feature request - mhdebokx - 2010-12-30 23:29
I organised my network photo storage using different folders. In favor of XBMC I added a lot of 'folder.jpg' in the folders, for seeing my own thumbnails.
Whithin the configuration pannel I'd like to see an option that 'thumbnails' can be skipped scanning (and are excluded from the database).
Eg: 'folder.jpg' and '*.tbn' are being skipped.
Remote Paths - human705 - 2011-01-04 17:20
It looks like there is an issue with authentication. I opened the path on the server (windows 9) and now it works.
- solexalex - 2011-01-09 02:21
Hello everyones and sorry for my late answer. My email subscription may have been wrong because I didn't get any notice about your answers...
Anyway, I'm going to try to answer all/many/some of your questions.
1/ about remote shares :
Tests are very poor right now.
Authentification : never tried to access a remote share from my addon if the authentification process has not been already made previously. My addon does not process to authentification (yet ?)
Path using \\ as prexif rather than smb:// : inside XBMC, a remote share is returned as smb://... wich does not mean anything to windows at all. So I manually changed the returned path in smb:// with \\ and it works like a charm. Linux users report me that it works great to, which was quiet exciting as it was easy to do . But mac users reports me that it does not work... "oh sh***". In fact for mac users, a remote share is written with the smb:// prefix and so, I don't need to change it when pick up from XBMC. So I need to detect mac users and keep the path 'as is' just for them.
2/ about adding any folders :
I just had a look on what enables me the xbmcgui python library, and I'm afraid that I can't do it.
I have only one dialog available for picking up a path. This path can use any of the videos/pictures/music/file sources. So you'll have to set a source by yourself to have for example a remote share. As default, only the fixed units (c: d: ...) are available. If you need just a local path, it is ok (but can be tricky to access up to the path you want).
So I think about another solution, to find a way to access to the sources from within my addon to enable user to set a new source, which will be then available to select for a path to scan for pics. Unfortunately, I was unable to call the source screen without exiting the addon... Anytime I show from my addon the sources screen, I'm not able to go back to the addon
I don't have other solution yet.
3/ videos in the addon : (you need latest SVN version to test it)
This has been added and once again it is very early beta attempt.
Date : I recently added the date of the video which should show just well (at least it does with Windows, if it does not with your platform, just tell me)
If the date is not correct, tell me and I'll look to find the problem (it may be due to GMT time and offset for your personnal timezone, or maybe the date I choose is not the correct one, or maybe the software you use to edit/backup/unload from your camera has a bad behaviour and changes the date where it shouldn't... Don't know exactly)
thumbnails : I don't know yet how to make the thumbnail within MPD. It shows only when you have started to play the video. But it seems that it is not stored for next time...
4/ exclude pictures using simple criterias :
I have in mind to do that. From the settings, you'll be able to exclude pictures using those criterias : (may change by time)
- minimal size in pixels (one of the width/height should be larger than xxx pixels)
- minimal file size (the file size should be at least xxx bytes to show the pic)
As for the keyword in the filename to exclude, I think to add it to the include / exclude item in the main screen of the addon. As you set the paths you want to scan or those you don't want to scan, I may add some expression (i.e : folder.jpg / thumbnail.* / ...) that will be excluded (the example of exlcluding *.ext in no sense as you just have to unset the .ext extension in the settings)
Hope all these answers are covering up correctly all your problems, if not, just tell me and I'll answer faster
- ppic - 2011-01-09 04:06
for auth on smb share, nothing more simple, use smb://user:[email protected]/sharename
- solexalex - 2011-01-09 12:11
Yes like I said, the remote share that my addon should use is :
- for mac :
smb://login: [email protected]/path
- for windows and linux :
\\login: [email protected]\path
The only thing I was not sure was the authentification process if nothing accessed to the remote share before my addon (no authentification made before my addon access).
I tested with windows and it authenticate without any trick. The only issue I encountered and I need to fix, is that when at the moment where I add a remote share to my scan paths, it does not works and I got the same error as human705. But when afterwards I clic on the item of the remote path, it scans correctly.
While talkin about Mac, I think Ppic you know the trick to know if a user is using mac, win or linux platform. Can you help me ?
Yesterday I fixed a bug that prevent to make a scan non-recursive. All the paths, wether are set to recursive or not, was scanning recursively. Now fixed, a pass setted to non recursive will not be recursive.
- solexalex - 2011-01-09 13:03
SVN rev163 :
This version should fixe remote share for mac users. To test it try to add a remote share, it should display the link as smb://server/path whether for all other platform users, it should display \\server\path.
- fiveisalive - 2011-01-09 23:10
solexalex Wrote:SVN rev163 :
It should also display it as smb://server/path for Linux (in other words *only* Windows uses the \\server\path syntax as far as I know).