Kodi Community Forum

Full Version: MediaElch - MediaManager for Mac/Linux/Win (with music library scraping)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey Komet, when is the new version expected? I see you closed the milestone for 9.5 on github, so are we to expect a new version soon ?
(2012-09-08, 07:45)ZaPHoN Wrote: [ -> ]This can't be installed in ubuntu 11.10 Oneiric

the dependency is not satisfiable libqtgui4 (>=4:4.8.0)

When trying to use the deb for libqtgui4 (>=4:4.8.0) from 4:4.8.1-0ubuntu2 it shows it's already installed.

Can provide some direction on this. It seems a lot of people are having issues with this package.
Maybe I'll have a look into this but I'm testing the deb's only with the latest stable Ubuntu release. All others are free to compile MediaElch on their own Smile

(2012-09-08, 14:28)GreenEyez Wrote: [ -> ]Hey Komet, when is the new version expected? I see you closed the milestone for 9.5 on github, so are we to expect a new version soon ?
I decided to skip the release of version 0.9.5 and go straight forward to 0.9.6 which will include the debug mode. So please stand by a little bit longer Wink
Hi Komet,

Very very good job on mediaelch (donated a little Angel), hope you will continue to improve it.

I'm facing a bug that i do not understand, here we go :

Configuration :
Mac OS X 10.7.3
MedialElch 0.9.4
XBMC 11
MySQL Server

Movies Path & MediaCenter Path correctly configured (smb://), separate folder checked.
XMBC MySQL correctly configured
Thumbnails Path correctly configured

Metadata already stored in MySQL are nearly complete (XBMC Database contains nearly all metadata for my files).
My goal is to use MediaElch to add/modify metadata to my movies.

When MediaElch scan my folder and associates movies folder with xbmc mysql metadata, I've got different behavior :
Case 1 - Some movies have their metadata and their poster/fanart displayed by MediaElch (The good way Big Grin)
Case 2 - Some movies have not their metadata and their poster/fanart displayed by MediaElch (again the database is complete for these movies), after a first analysis it seems to be related with m2ts files or with movies with special character in their title like "L'Âge de glace 3".
Case 3 - Some movies does not have metadata but MediaElch display their respective poster/fanart found in the thumbnail cache (I though that the xbmc thumbnail cache was related to the informations stored in the xbmc database), that's this behavior that i do not understand Huh.

As usual screenshots are a better way to explain :

Case 1 :
Image

Case 2 :
Image

Case 3 :
Image

Hope you can help, regards.

PS : As you can see english is not my mother tongue, so if you don't understand, i will understand...

Zestef.

(2012-09-09, 09:58)zestef Wrote: [ -> ]Hi Komet,

Very very good job on mediaelch (donated a little Angel), hope you will continue to improve it.

I'm facing a bug that i do not understand, here we go :

Configuration :
Mac OS X 10.7.3
MedialElch 0.9.4
XBMC 11
MySQL Server

Movies Path & MediaCenter Path correctly configured (smb://), separate folder checked.
XMBC MySQL correctly configured
Thumbnails Path correctly configured

Metadata already stored in MySQL are nearly complete (XBMC Database contains nearly all metadata for my files).
My goal is to use MediaElch to add/modify metadata to my movies.

When MediaElch scan my folder and associates movies folder with xbmc mysql metadata, I've got different behavior :
Case 1 - Some movies have their metadata and their poster/fanart displayed by MediaElch (The good way Big Grin)
Case 2 - Some movies have not their metadata and their poster/fanart displayed by MediaElch (again the database is complete for these movies), after a first analysis it seems to be related with m2ts files or with movies with special character in their title like "L'Âge de glace 3".
Case 3 - Some movies does not have metadata but MediaElch display their respective poster/fanart found in the thumbnail cache (I though that the xbmc thumbnail cache was related to the informations stored in the xbmc database), that's this behavior that i do not understand Huh.

As usual screenshots are a better way to explain :

Case 1 :
Image

Case 2 :
Image

Case 3 :
Image

Hope you can help, regards.

Zestef.
Thanks for donating!

Your errors seems to be caused by special characters in the movie filename.
I'll look into this when the next release is done.

The way XBMC stores thumbnails is the following: It creates a hash of the full path to the movie, for example "smb://10.0.1.3/movies/movie/filename.mkv" becomes "c30d7440". Then the thumbnail is stored in ".xbmc/userdata/Thumbnails/Video/c/c30d7440.tbn".

What's going wrong in case 2 and 3 is there is some bug in MediaElchs XBMC sql interface, maybe the special characters don't get escaped or something like that. So MediaElch couldn't retrieve the metadata from the database.
In case 2 my implementation of the hash calculation seems also to be broken when it comes to filenames with special characters. So I may be constructing a wrong hash.
In case 3 the hash calculation is ok (that's because you see the thumbnails) but the sql query is wrong.

As said earlier, the next release comes with a debug log. With this information it would be easier to track bugs like this down.
Hi Daniel,

I analyse a little bit more my results and it's seems that the SQL query is wrong (case 2 & 3) when no original name is set in the xbmc database.
In fact MediaElch doesn't retrieve the metadata from the xbmc database when there is only the name set but not the original name.

About the hash calculation i will try to change some movies with special characters.

Bye
Stephane.
Original name shouldn't matter. I'm using the filename to retrieve the metadata from XBMCs database.
It's not up to you to change your movies filenames, it's my part to fix the hash calculation Wink
Hi Komet,
just me again with some featurerequests :-)

1) Movies:
would it be possible to add a search by imdb id ? Sometimes it would be much easier to identify the movie by this id specially if you are searching for a movie title specially if the movie title is short and contains a secial character aka "Der Grüffelo"

2) TV Shows & TV Show episode list
- it would be very nice to support people who have DVD structures for shows :
24
--- 24 Season 01
------- 24 S01E01E02E03E04
------------ VIDEO_TS
------------ AUDIO_TS
right now for media-elch this will result in 1 Episode 24 Season 01 Episode 01, witch seams to be wrong.

3) Right now i am still searching for some kind of interoperability between media-elch and vimediamanager, which seams to work for most items with the exception of poster and fanart. Both programms storing the same files and i have no idea why these files do not show up in the "oposite" mediamanager.
Maybe it would be a step forward if you both get in touch for the benefit for all of us :-)
Thanks for listining
Linus
Hi Komet,

Yesterday I managed to compile the latest version of MediaElch from GitHub on my MAC (ouch compiling the mysql driver was not easy for me).
So now that the debug log is active, I have a little bit more information about my problems.

Quote:What's going wrong in case 2 and 3 is there is some bug in MediaElchs XBMC sql interface, maybe the special characters don't get escaped or something like that. So MediaElch couldn't retrieve the metadata from the database.
In case 2 my implementation of the hash calculation seems also to be broken when it comes to filenames with special characters. So I may be constructing a wrong hash.
In case 3 the hash calculation is ok (that's because you see the thumbnails) but the sql query is wrong.

As said earlier, the next release comes with a debug log. With this information it would be easier to track bugs like this down.

Case 2 : I've got this problem only with the three Ice Age movies, the french Spelling is "L'Âge de glace", i think the problem concerns the "Â" character, and by consequence the hash calculation :
Here is an example with the ice age fanart :
Real Path (on my system) = "/Users/zestef/Library/Application Support/XBMC/userdata/Thumbnails/Video/Fanart/4d1b627f.tbn"
fanartPath ( from MediaElch Log) = "/Users/zestef/Library/Application Support/XBMC/userdata/Thumbnails/Video/Fanart/f4598df6.tbn"

Case 3 : the problem is on the apostrophe character ' who is replaced by a double apostrophe character '' in your XbmcSQL.cpp file (sqlWhereFile / loadMovie process), I've just changed the double apostrophe back to a simple apostrophe and the problem is gone. But maybe there are others implications that i don't understand.

I will make more test in the future with tv shows who seems to have problems with poster, season poster and banner.

Thanks for your work.

Zestef.
Komet, speaking of github, i see 0.9.6 is completed (which includes the new debug options as far as i can tell), any plans on releasing the binaries for it, or are you also skipping this version and going to 0.9.7 directly ?
(2012-09-19, 09:45)zestef Wrote: [ -> ]Case 2 : I've got this problem only with the three Ice Age movies, the french Spelling is "L'Âge de glace", i think the problem concerns the "Â" character, and by consequence the hash calculation :
Here is an example with the ice age fanart :
Real Path (on my system) = "/Users/zestef/Library/Application Support/XBMC/userdata/Thumbnails/Video/Fanart/4d1b627f.tbn"
fanartPath ( from MediaElch Log) = "/Users/zestef/Library/Application Support/XBMC/userdata/Thumbnails/Video/Fanart/f4598df6.tbn"

Case 3 : the problem is on the apostrophe character ' who is replaced by a double apostrophe character '' in your XbmcSQL.cpp file (sqlWhereFile / loadMovie process), I've just changed the double apostrophe back to a simple apostrophe and the problem is gone. But maybe there are others implications that i don't understand.

Case 2: I checked the hash functions and actually the problem lays not here. It seems like XBMC doesn't take the path with special characters included. I looked through XBMCs code and found the hash function they use. It's basically the same as mine.
I also tried out the functions mentioned in the wiki (http://wiki.xbmc.org/index.php?title=thumbnails#Hashing) and guess what: The hash they calculate is also not the same as in XBMC when it comes to filenames with special characters...
On IRC I already asked but don't got an answer. If somebody might help me here, you're welcome! Smile

Case 3: The double apostroph is correct, escaping of apostrophs in SQL is done with another apostroph. The problem is the accent in "Vidéos" which is causing problems with the sql query. I experimented a little bit but haven't found a solution yet.
(2012-09-19, 09:50)GreenEyez Wrote: [ -> ]Komet, speaking of github, i see 0.9.6 is completed (which includes the new debug options as far as i can tell), any plans on releasing the binaries for it, or are you also skipping this version and going to 0.9.7 directly ?

Yes, will be released today Smile But don't rely on the milestones on github, they get automatically completed when there's no issue left. Sometimes I don't record everything as issue in github or decide to include some issues from later milestones.
(2012-09-08, 16:08)Komet Wrote: [ -> ]
(2012-09-08, 07:45)ZaPHoN Wrote: [ -> ]This can't be installed in ubuntu 11.10 Oneiric

the dependency is not satisfiable libqtgui4 (>=4:4.8.0)

When trying to use the deb for libqtgui4 (>=4:4.8.0) from 4:4.8.1-0ubuntu2 it shows it's already installed.

Can provide some direction on this. It seems a lot of people are having issues with this package.
Maybe I'll have a look into this but I'm testing the deb's only with the latest stable Ubuntu release. All others are free to compile MediaElch on their own Smile

(2012-09-08, 14:28)GreenEyez Wrote: [ -> ]Hey Komet, when is the new version expected? I see you closed the milestone for 9.5 on github, so are we to expect a new version soon ?
I decided to skip the release of version 0.9.5 and go straight forward to 0.9.6 which will include the debug mode. So please stand by a little bit longer Wink

I'm getting an error 127 at the end. Can you tell me what's wrong please.

Code:
git clone https://github.com/Komet/MediaElch.git
Cloning into MediaElch...
remote: Counting objects: 1513, done.
remote: Compressing objects: 100% (726/726), done.
remote: Total 1513 (delta 1105), reused 1186 (delta 778)
Receiving objects: 100% (1513/1513), 1.07 MiB | 499 KiB/s, done.
Resolving deltas: 100% (1105/1105), done.
mario@MBHTPC:~$ cd MediaElch
mario@MBHTPC:~/MediaElch$ qmake && make
/usr/bin/uic-qt4 main/MainWindow.ui -o ui_MainWindow.h
/usr/bin/uic-qt4 movies/MovieSearch.ui -o ui_MovieSearch.h
/usr/bin/uic-qt4 movies/MovieWidget.ui -o ui_MovieWidget.h
/usr/bin/uic-qt4 movies/FilesWidget.ui -o ui_FilesWidget.h
/usr/bin/uic-qt4 main/AboutDialog.ui -o ui_AboutDialog.h
/usr/bin/uic-qt4 smallWidgets/FilterWidget.ui -o ui_FilterWidget.h
/usr/bin/uic-qt4 main/MessageBox.ui -o ui_MessageBox.h
/usr/bin/uic-qt4 main/Message.ui -o ui_Message.h
/usr/bin/uic-qt4 tvShows/TvShowFilesWidget.ui -o ui_TvShowFilesWidget.h
/usr/bin/uic-qt4 tvShows/TvShowWidget.ui -o ui_TvShowWidget.h
/usr/bin/uic-qt4 tvShows/TvShowWidgetEpisode.ui -o ui_TvShowWidgetEpisode.h
/usr/bin/uic-qt4 tvShows/TvShowWidgetTvShow.ui -o ui_TvShowWidgetTvShow.h
/usr/bin/uic-qt4 tvShows/TvShowSearch.ui -o ui_TvShowSearch.h
/usr/bin/uic-qt4 smallWidgets/ImageLabel.ui -o ui_ImageLabel.h
/usr/bin/uic-qt4 globals/ImagePreviewDialog.ui -o ui_ImagePreviewDialog.h
/usr/bin/uic-qt4 sets/SetsWidget.ui -o ui_SetsWidget.h
/usr/bin/uic-qt4 sets/MovieListDialog.ui -o ui_MovieListDialog.h
/usr/bin/uic-qt4 settings/Settings.ui -o ui_Settings.h
/usr/bin/uic-qt4 globals/ImageDialog.ui -o ui_ImageDialog.h
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I. -I. -o main.o main.cpp
make: g++: Command not found
make: *** [main.o] Error 127



Oops didn't have g++ installed. This fixed it.

sudo apt-get install build-essential g++
(2012-09-20, 09:02)Komet Wrote: [ -> ]
(2012-09-19, 09:45)zestef Wrote: [ -> ]Case 3 : the problem is on the apostrophe character ' who is replaced by a double apostrophe character '' in your XbmcSQL.cpp file (sqlWhereFile / loadMovie process), I've just changed the double apostrophe back to a simple apostrophe and the problem is gone. But maybe there are others implications that i don't understand.
Case 3: The double apostroph is correct, escaping of apostrophs in SQL is done with another apostroph. The problem is the accent in "Vidéos" which is causing problems with the sql query. I experimented a little bit but haven't found a solution yet.
Hi Komet,

Sorry to insist but I compiled your code (XbmcSQL.cpp file) with the following change and every SQL query works (all my movies metadata are now displayed in mediaElch) :
Code:
if (m_isMySQL) {
            file.replace("\\", "\\\\");
            qDebug() << "Is MySQL, file=" << file;
        }
        sqlWhereFile = QString("M.c22='%1'").arg(file.replace("'", "''"));
    } else {
        qDebug() << "Movie is made of multiple files";
        if (m_isMySQL) {
            file.replace("\\", "\\\\\\\\");
            qDebug() << "Is MySQL, file=" << file;
        }
        sqlWhereFile = QString("M.c22 LIKE 'stack://%%1%'").arg(file.replace("'", "''"));
    }

Replaced by :
Code:
if (m_isMySQL) {
            file.replace("\\", "\\\\");
            qDebug() << "Is MySQL, file=" << file;
        }
        sqlWhereFile = QString("M.c22='%1'").arg(file.replace("'", "'"));
    } else {
        qDebug() << "Movie is made of multiple files";
        if (m_isMySQL) {
            file.replace("\\", "\\\\\\\\");
            qDebug() << "Is MySQL, file=" << file;
        }
        sqlWhereFile = QString("M.c22 LIKE 'stack://%%1%'").arg(file.replace("'", "'"));
    }

Regards
Zestef
(2012-09-20, 17:08)zestef Wrote: [ -> ]
(2012-09-20, 09:02)Komet Wrote: [ -> ]
(2012-09-19, 09:45)zestef Wrote: [ -> ]Case 3 : the problem is on the apostrophe character ' who is replaced by a double apostrophe character '' in your XbmcSQL.cpp file (sqlWhereFile / loadMovie process), I've just changed the double apostrophe back to a simple apostrophe and the problem is gone. But maybe there are others implications that i don't understand.
Case 3: The double apostroph is correct, escaping of apostrophs in SQL is done with another apostroph. The problem is the accent in "Vidéos" which is causing problems with the sql query. I experimented a little bit but haven't found a solution yet.
Hi Komet,

Sorry to insist but I compiled your code (XbmcSQL.cpp file) with the following change and every SQL query works (all my movies metadata are now displayed in mediaElch) :
Code:
if (m_isMySQL) {
            file.replace("\\", "\\\\");
            qDebug() << "Is MySQL, file=" << file;
        }
        sqlWhereFile = QString("M.c22='%1'").arg(file.replace("'", "''"));
    } else {
        qDebug() << "Movie is made of multiple files";
        if (m_isMySQL) {
            file.replace("\\", "\\\\\\\\");
            qDebug() << "Is MySQL, file=" << file;
        }
        sqlWhereFile = QString("M.c22 LIKE 'stack://%%1%'").arg(file.replace("'", "''"));
    }

Replaced by :
Code:
if (m_isMySQL) {
            file.replace("\\", "\\\\");
            qDebug() << "Is MySQL, file=" << file;
        }
        sqlWhereFile = QString("M.c22='%1'").arg(file.replace("'", "'"));
    } else {
        qDebug() << "Movie is made of multiple files";
        if (m_isMySQL) {
            file.replace("\\", "\\\\\\\\");
            qDebug() << "Is MySQL, file=" << file;
        }
        sqlWhereFile = QString("M.c22 LIKE 'stack://%%1%'").arg(file.replace("'", "'"));
    }

Regards
Zestef

Are you sure it isn't working without your change? With this change you will run into trouble when a filename contains an apostroph.
(2012-09-20, 17:11)Komet Wrote: [ -> ]Are you sure it isn't working without your change? With this change you will run into trouble when a filename contains an apostroph.
Yes i'm 100% sure (and i have filename with apostroph), Here is the test i've just done :

Test movie :
Volumes/Vidéos/Animations/Autres/Yogi L'ours [2010]/Yogi L'ours [2010].mkv

-> MediaElch compiled with double apostroph : the mediadata aren't retrieved from the mysql database (the "new flag is displayed before the title name in the left column).
with the following log :
Code:
"void MovieWidget::setMovie(Movie *)                                    :" Entered, movie= "Yogi l'ours [2010]"
"bool Movie::loadData(MediaCenterInterface *, bool)                     :" Entered, force= false
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Entered, movie= "Yogi l'ours [2010]"
"QString XbmcSql::mediaCenterPath(QString)                              :" Entered, file= "/Volumes/Vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv"
"QString XbmcSql::mediaCenterPath(QString)                              :" mediaCenterFile= "smb://srv-media/vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" File "/Volumes/Vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv" becomes "smb://srv-media/vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Movie is a single file movie
"virtual bool XbmcSql::loadMovie(Movie *)                               :" isUnixFile= true
"virtual bool XbmcSql::loadMovie(Movie *)                               :" fileSplit= ("smb:", "", "srv-media", "vidéos", "Animations", "Autres", "Yogi l'ours [2010]", "Yogi l'ours (2010).mkv")
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Is MySQL, file= "smb://srv-media/vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" sqlWhereFile= "M.c22='smb://srv-media/vidéos/Animations/Autres/Yogi l''ours [2010]/Yogi l''ours (2010).mkv'"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Single file movie
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Got no result, trying foldername
"virtual bool XbmcSql::loadMovie(Movie *)                               :" file is now "smb://srv-media/vidéos/Animations/Autres/Yogi l''ours [2010]/"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" No entry found for movie, giving up
"bool Movie::loadData(MediaCenterInterface *, bool)                     :" Loaded false

-> MediaElch compiled with simple apostroph : the mediadata are retrieved from the mysql database and correctly displayed.
Code:
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Entered, movie= ""
"QString XbmcSql::mediaCenterPath(QString)                              :" Entered, file= "/Volumes/Vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv"
"QString XbmcSql::mediaCenterPath(QString)                              :" mediaCenterFile= "smb://srv-media/vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" File "/Volumes/Vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv" becomes "smb://srv-media/vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Movie is a single file movie
"virtual bool XbmcSql::loadMovie(Movie *)                               :" isUnixFile= true
"virtual bool XbmcSql::loadMovie(Movie *)                               :" fileSplit= ("smb:", "", "srv-media", "vidéos", "Animations", "Autres", "Yogi l'ours [2010]", "Yogi l'ours (2010).mkv")
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Is MySQL, file= "smb://srv-media/vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" sqlWhereFile= "M.c22='smb://srv-media/vidéos/Animations/Autres/Yogi l'ours [2010]/Yogi l'ours (2010).mkv'"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Single file movie
"virtual bool XbmcSql::loadMovie(Movie *)                               :" Got no result, trying foldername
"virtual bool XbmcSql::loadMovie(Movie *)                               :" file is now "smb://srv-media/vidéos/Animations/Autres/Yogi l'ours [2010]/"
"virtual bool XbmcSql::loadMovie(Movie *)                               :" idMovie= 84
"bool Movie::loadData(MediaCenterInterface *, bool)                     :" Loaded true

Hope it's help.

Zestef