XBMC MAL Updater Plugin
#16
it does not seem to be actually using the episode details for updating MAL

for example my naruto was last updated around ep 220

I played season 13 ep 4 and it changed it to a 1

I played season 13 ep 3 and it changed it to 2

I played season 11 ep 14 and nothing changed ??

Naruto Shippuuden - S13E04 - Secrets of the Reanimation Jutsu [2012-05-24].tbn
Naruto Shippuuden - S13E04 - Secrets of the Reanimation Jutsu [2012-05-24].nfo
Naruto Shippuuden - S13E04 - Secrets of the Reanimation Jutsu [2012-05-24].mkv

is how my stuff is Organized

during setup i told each and every naruto season 1 - 13 to map to naruto shippuuden

I thought when I deinstalled MAL plugin it wiped out its folder I swear I saw it disappear in the plugin folder
I guess i was wrong as it remembered my username / pass in the morning I will do a fresh .xbmc folder for tinkering with

when ever I finished a video it said updating x amount of shows ( even tho only 1x show was watched .. and it was a random amount of shows

I could not see anything in the logs to tell me what MAL tried doing :S
Reply
#17
Ah, ok. I didn't log as much as I maybe should have, but it should make a note every time it updates something on MAL. But I can see where the confusion is coming from here.

MAL just lists number of episodes watched - not the specific episode. So, if you only watch one episode in the middle of the season of something, it'll only update to a 1, so in your example, it won't update to a 4 because that's the last episode number watched, not number of episodes watched. It is kind of silly, but I understand their reasoning - it would be much more unwieldy to have a user mark each individual episode as watched like XBMC does.

With Season 11 episode 14, assuming it's in your library (if it isn't then mal can't see it), I would assume that you didn't go far enough in to have XBMC mark it as watched. Although, I notice that you mapped all 13 seasons of naruto in xbmc to a single show in mal. This is another limitation I'm trying to figure out (I had forgotten about it, though) that I noticed with Eureka Seven. MAL maps E7 as a 50 episode show in one season, but the TVDB, and by extension XBMC, maps E7 as 4 separate seasons. XBMAL resets the count for each season, which means that only the season with the greatest number of watched episodes will get counted. I'm not sure how to fix this yet.

Your organization looks perfectly fine and shouldn't cause any problems. The fact that XBMAL is updating at least proves that it can see the XBMC library.

Finally, the settings for username/password and the config file are stored in /userdata/addon_data/script.xbmal, and that particular folder is not removed when you uninstall the addon (this is true of all addons that use that folder or store settings in some way). You don't have to make a fresh .xbmc folder, you just need to remove that addon_data folder. I would backup the config.xml file first though, particularly if you have a lot of shows (mine lists 206 items, which is a real pain to update).

The number of shows it says it's updating is the number that it sees in xbmc as incomplete. Most of the time they won't change on MAL, but it still attempts to change them. In my case, it's listing 17 (maybe it's 16 now that I've finished katanagatari, I haven't paid attention...) because it sees that I've started watching 17 shows in XBMC but haven't finished them. It updates them, regardless of if they need updated, because xbmal doesn't keep track of what the last number updated was from either mal or xbmc, because it's possible the mal number will change outside of xbmc (if you watch it at a friend's place, for example).

All that said, though, you should see XBMAL make a note in the log each time it marks a show as completed, plan to watch, or watching in MAL.

EDIT:

I should correct myself on the second to last paragraph. It uses the MAL status first to determine if it should try to update the show or not - if the status is 'watching' or 'plan to watch', and the number of episodes watched isn't 0, it'll update, or if it can't find a status for the show in MAL (indicating you haven't yet added it to mal), it'll add it for you with the appropriate status. If you add and immediately watch something like Pale Cocoon, for example, it'll add it to MAL for you and immediately mark it as completed, but if add something else and don't watch it immediately and watch something else instead, it'll add it to MAL and add it to plan to watch. It won't touch anything in any other category.
Reply
#18
now all that is really needed is this plugin to automatically add the series that you are watching to MAL


how would you do Anime like Natsume Yuujinchou
( your plugin detects them just fine i just have no idea how to get them into XBMC as seasons Tongue )
would you have a main Folder called Natsume Yuujinchou then inside have Natsume Yuujinchou Shi / Natsume Yuujinchou San etc
just trying to work out how to add them as seasons


I think I see my ep problem

I gave Shiki a go last night and only played the last ep

it does not update any other eps now

so I guess no choice but to update them in order ( still trying to work out how to add its specials )

how ever why would it have dropped my naruto from 220 ish to 1 ?

normally you would only watch the show's in order so it should do fine

so I take it your not going to make any option for it to update the MAL number using the file number being played?

ie to help those keep their MAL up to date with those 5 yr old series ie one piece

*edit*

it just made a lair out of me
cleared XBMC folder and started fresh

I watched Shiki ep 1 2 3 in order they updated i watched ep 7 and 8 it updated to 5 eps then watched ep 4 it updated to 6

so unsure why when I watched ep 24 it never updated any of the eps watched

also I did not have any password issues with v4

reason for using root is for clean db I can just delete the .xbmc folder and start tinkering with out effecting MYSQL data base
Reply
#19
I haven't actually tried it out of order, that's just what should happen. I'll look into why that happened with Shiki.

As for specials, XBMAL doesn't support them right now, and may not. XBMC lists all specials in season 0, and combines what are multiple special "seasons" on MAL into that single "season", which makes it effectively impossible for XBMAL to understand what's going on. I might be able to make it work, though, if I can figure out the multiple seasons in TVDB to single season on MAL problem, though. Either way, it's still a long shot.

I don't know why it would have dropped naruto's count - it shouldn't have. That's a bug that I'll look into as soon as I can. Basically, it should say "What's the number in mal? What's the number in xbmc? Which is greater?" and use the number that is greater. So if XBMC's watch list has more watched, it'll assume that you haven't marked them in mal yet, and if mal's watchlist is greater, than it'll assume you watched episodes outside of xbmc. That's what's supposed to happen, anyway.

EDIT: Forgot to answer your first question -_-. Higurashi is similar with Kai and Rei, and what I do there is simply number the seasons like they are on the TVDB. Here's the page for Natsume Yuujinchou (called Natsume's Book of Friends there): http://thetvdb.com/?tab=seasonall&id=82788&lid=7, so what I would have is just Natsume's Book of Friends/Season 01/... and Natsume's Book of Friends/Season 02/.... I let the filenames themselves describe if the season has a specific name. For example, in Kore wa Zombie Desu Ka, Season 1 is just Kore Wa Zombie Desu Ka, but Season 2 is Kore Wa Zombie Desu Ka Of The Dead. However, in XBMC it's just Is This A Zombie/Season 01 and Is This A Zombie/Season 02 (incidently, Is This a Zombie is the english name and the name that shows up in the tvdb). Hopefully that answers your question.

Also, glad to hear the counting is working as expected, it may have been a one-off bug (which I'll have to track down anyway, but I'm not going to concern myself too much with it unless it keeps getting reports). I understand your reasoning for using root, though I have to advise against it Wink I'm not going to tell you not to do it. It's doubtful that xbmal will screw anything up in your system, though I can't say the same for xbmc xD. Also good to hear you have no password issues with v0.4. I think I might push onto beta once I get the messed up "which is greater?" thing working and have one or two other people test it.

Quick update, another edit just because I don't want to make yet another new post (although I should): 0.4.1 is up and should fix the "which is greater?" bug. I had mistakenly thought one field I was pulling from MAL was the "number watched", but it was actually the number of episodes in the show, so it caused a bit of an error. That's fixed now. It's also up on the repo, so you should be able just to update from the menu, assuming you've been installing from the repo. If you don't see an update, try forcing a refresh.
Reply
#20
Seems to be still Broken now it does not update something Manually done in MAL ?

been testing setting Naruto / bleach at 200


cheers I didn't think of Natsume's Book of Friends as tvdb did not return anything for natsume

which is what really bothers me thetvdb gets some and anidb get others .. neither seem to get it all
Reply
#21
That's not to say it won't update something done manually, it won't revert an update done manually is more accurate - to some extent. If the number of watched episodes listed in MAL is greater than the number listed in XBMC, then XBMAL won't update. However, if the number of watched episodes listed in XBMC is greater than the number of watched episodes listed in MAL, then it will update.

So, if you have Naruto/Bleach set to ~200 in MAL, but none of them are marked as watched in XBMC until you start testing (meaning that only 1, 2, 3, etc. are being marked as watched), then XBMAL will refuse to update MAL because it doesn't want to revert everything.

Although I'm not sure what seems to still be broken, could you be more specific? Also, even if you update the plugin, sometimes you'll still be running the previous version, because of the way xbmal is loaded into xbmc. When xbmc starts, xbmal is loaded into xbmc, and doesn't stop running unless it errors out (although it really doesn't do anything in the meantime). This means when xbmal is updated, it's still running, as xbmc doesn't unload a running plugin (as far as I can tell) when it updates it. So in order to kill the service and start the new one, a restart may still be necessary, although I'm not 100% sure.
Reply
#22
Your expatiation seems valid
I will test with smaller numbers
( I only have around 3 seasons actually available atm for XBMC)

when I have done plugin updates i have deinstalled / closed / opened / reinstalled
or just scraped .xbmc and started fresh


once I move over to XBMC fully this Plugin will be God send for me Tongue
( Pending an FM2 main board release so I can play 10 bit anime
( currently ATOM-ION HTPC Windows Pc with pot player / MAL Updater)

looks like i will have to tinker with my files so I can get XBMC to match with MAL
( only recently changed media system 99% of my Anime files are on the old file server )

HDD flood prices stopped me from the full rebuild I wanted to do
Reply
#23
Alright, that's probably the best way to re-install the plugin for testing.

I'm glad to hear it'll be useful, though! I'm not sure if XBMC supports 10-bit on it's own right now, you may need to compile ffmpeg and tell xbmc to use an external ffmpeg in order for it to work.

You shouldn't have to tinker too terribly much, particularly if all of your files are listed the same as in your earlier example. It just depends on how you have xbmc scraping and what scraper you use. It should work even with remote stuff, as xbmal doesn't care where the files themselves are, just what the show, season, and episode are.

HDD flood prices also stopped me from getting a new backup drive. Curse you water! Why do you have to go and flood things?
Reply
#24
First do we need to download and install python on the system. If so which version do you recommend.

Second when ever I try to run the script I get this error message:
Error
Script Failed! : script.xbmal

The log shows this:
15:53:41 T:1624 NOTICE: -->Python Interpreter Initialized<--
15:53:41 T:1624 ERROR: Error Type: <type 'exceptions.ImportError'>
15:53:41 T:1624 ERROR: Error Contents: No module named jsonrpclib
15:53:41 T:1624 ERROR: Traceback (most recent call last):
File "...\AppData\Roaming\XBMC\addons\script.xbmal\default.py", line 16, in <module>
import myanimelist, xbmal
File "...\AppData\Roaming\XBMC\addons\script.xbmal\resources\lib\xbmal.py", line 4, in <module>
import simplejson, os, sys, itertools, math, jsonrpclib
ImportError: No module named jsonrpclib
Reply
#25
Good morning, sir!

For your first question, python should not need to be installed, as XBMC has a built-in python interpreter. Should you want to install one for whatever reason, as far as this script goes, I would recommend the latest 2.X version. I use python 2.7.3.

As for your second question, the error means that you don't have a module I'm calling, however, I don't believe I use that module anymore. I have it there for testing and debugging purposes, and I think I forgot to remove it when I pushed the code to github. I have just removed it, though I didn't do a version bump for it. If you installed from the zip file, it should be ready to be updated within 20 minutes or so now. If you cloned the git repository, you can simply run a git pull and get the fixed version.

I apologize! It should work now. Of course, this is still somewhere in the alpha-beta range, so there may still be some bugs. Let me know if you have any more issues!
Reply
#26
I had trouble updating through xbmc so I just cloned the new files into place.

Got another issue but the script ran for longer this time. I got a pop up saying xbmal setup. It said four percent then a pop up with script failed.

Here is the relevant log:
13:48:33 T:2972 NOTICE: -->Python Interpreter Initialized<--
13:48:34 T:2972 ERROR: Error Type: <type 'exceptions.AttributeError'>
13:48:34 T:2972 ERROR: Error Contents: ElementTree instance has no attribute 'iterfind'
13:48:34 T:2972 ERROR: Traceback (most recent call last):
File "...\AppData\Roaming\XBMC\addons\script.xbmal\default.py", line 141, in <module>
w = MainDiag()
File "...\AppData\Roaming\XBMC\addons\script.xbmal\default.py", line 89, in __init__
mappings = lg.generateList(pDialog)
File "...\AppData\Roaming\XBMC\addons\script.xbmal\default.py", line 41, in generateList
if self.config.showInConfig(season[0]['tvshowid'], season[0]['season']) == False:
File "...\AppData\Roaming\XBMC\addons\script.xbmal\resources\lib\xbmal.py", line 38, in showInConfig
for item in self.tree.iterfind('show'):
AttributeError: ElementTree instance has no attribute 'iterfind'
Reply
#27
Ok, so I may have overestimated what version of python XBMC is using. That's my guess, anyway. Based on your error, iterfind hasn't yet been added to the interpreter, which indicates it's pre-2.7. I believe Eden is post-2.4, so that at least narrows my range.

Anyway, I added an un-tested update to the appropriate file in both master and working, though I haven't updated the zip yet. Could you clone that into place and see if it works? I'm not sure if there is anywhere else I use things added in python 2.7, so there's the distinct possibility it will fail again. I apologize for the inconvenience, but think, you're making it easier for everyone else!

I can't test it myself for two reasons - right now, I don't have any of my devices running xbmc at my disposal, but more importantly, it seems all three of my devices are using python 2.7.

Anyway, let me know if it works, or of any other bugs you encounter. Hopefully we can get this ironed out.
Reply
#28
We're getting closer. The script ran through my library fine. It displayed the "select a show to fix mapping" menu and I could map and search MAL correctly.

When I went to save got a script failed error.

Log:
16:39:25 T:2556 NOTICE: -->Python Interpreter Initialized<--
16:39:35 T:2556 WARNING: Trying to add unsupported control type 1
16:40:56 T:2556 WARNING: Previous line repeats 12 times.
16:40:56 T:2556 NOTICE: ### [XBMAL] - Writing new mappings file
16:40:56 T:2556 ERROR: Error Type: <type 'exceptions.TypeError'>
16:40:56 T:2556 ERROR: Error Contents: write() got an unexpected keyword argument 'xml_declaration'
16:40:56 T:2556 ERROR: Traceback (most recent call last):
File "...\AppData\Roaming\XBMC\addons\script.xbmal\default.py", line 141, in <module>
w = MainDiag()
File "...\AppData\Roaming\XBMC\addons\script.xbmal\default.py", line 122, in __init__
lg.config.writeConfig()
File "...\AppData\Roaming\XBMC\addons\script.xbmal\resources\lib\xbmal.py", line 64, in writeConfig
self.tree.write(self.xmlFile, encoding="UTF-8", xml_declaration=True)
TypeError: write() got an unexpected keyword argument 'xml_declaration'

It is not an inconvenience. I have written software too, (all in java so no help with python) and I know how things are supposed to work but somewhere along the line implementation is non ideal so it doesn't work.
Reply
#29
Good! At least we're part way there.

I'm guessing the xml_decleration has the same compatibility problem, though if that's true it's not well documented. I wrapped it in a try except, so hopefully that'll fix the issue for not-2.7. Just clone master again and hopefully all will be well.

Also good to know you've developed as well! That should make things a bit easier.

Well, let me know if it works.
Reply
#30
It mostly works. Thanks for everything. I was able to save the mapping, and the script started listening. I watched a show in its entirety and it correctly updated in mal.

There are some things I still have fetter out the cause then I can list a more detailed description. After finishing some shows the pop up said two shows were edited. Recently it said zero shows were updated, but I fast forwarded through everything in order to test. Also when I re watched some shows the script said it updated an episode but it did not update MAL (a setting I really like)
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC MAL Updater Plugin0