Skip to content

Commit

Permalink
changed .match guid to mal-id
Browse files Browse the repository at this point in the history
using only guid as a key is too ambiguous for a MyAnimeList specific usage.
The key for the MyAnimeList ID was changed to mal-id.
  • Loading branch information
Fribb committed Sep 15, 2022
1 parent c0c2d45 commit cf9e0ae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Contents/Code/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,10 @@ def readMatchFile(self, path):
elem = elem.replace("\r", "")
if elem.startswith('title'):
matchValues['title'] = elem.replace("title: ","")
if elem.startswith('guid'):
matchValues['guid'] = elem.replace("guid: ","")
if elem.startswith('mal-id'):
matchValues['mal-id'] = elem.replace("mal-id: ","")

Log.Debug("[" + self.AGENT_NAME + "] " + ".match values: " + str(matchValues))
return matchValues

except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions Contents/Code/utils/myanimelistagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def search(self, results, media, lang, manual, type):
Log.Info("[" + self.AGENT_NAME + "] " + ".match file found")
matchFileDict = self.COMMON_UTILS.readMatchFile(matchFileLocation)

if "guid" in matchFileDict:
if "mal-id" in matchFileDict:
# the MyAnimeList ID is available in the .match file
title = title + "[mal-" + matchFileDict['guid'] + "]"
title = title + "[mal-" + matchFileDict['mal-id'] + "]"
elif "title" in matchFileDict:
# a title is available in the .match file, use that instead of the media title
title = matchFileDict['title']
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ Since I didn't want it to be Plex-specific, the Agent will read a .match file fr
* .match
* 91 Days - 01.ext

Currently, the Agent will only check for 2 values `title` and `guid`, the `guid` is prioritized so that if a GUID is set, the Agent will force a match to that ID.
Currently, the Agent will only check for 2 values `title` and `mal-id`, the `mal-id` is prioritized so that if a GUID is set, the Agent will force a match to that ID.

A Match file could therefore look something like this:

```
title: 91 Days
guid: 32998
mal-id: 32998
```

With Applications like FileBot or ShokoServer that can rename your files automatically and that use AniDB,
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue, 13 Sep 2022 13:51:14 +0200
#Thu, 15 Sep 2022 07:17:54 +0200
major.number=7
minor.number=3
build.number=0
build.number=1

0 comments on commit cf9e0ae

Please sign in to comment.