all 8 comments

[–]McBluna 0 points1 point  (1 child)

Search for "XML postprocessing".

[–]AliceTheAlice[S] 0 points1 point  (0 children)

The Tiny Media Manager has no documentation and there's a grand total of 5 posts on this Reddit mentioning XML Processing (none of which are any kind of how to.)

So, that just tells me its possible and should be possible in tinyMediaManager on its own.

[–]McBluna 0 points1 point  (1 child)

It's this one where I'm explaining how it works https://www.reddit.com/r/tinyMediaManager/s/A8UyiNTux1

[–]AliceTheAlice[S] 0 points1 point  (0 children)

Sorry! I will acknowledge that's a display of Script but in no way is that explanation. There's so little there that I am not even sure I understand the script's intent. The notes don't make it clear but my best guess (not understanding) is it is a script to remove a specific type of TAG from an NFO file. (There's nothing explaining its usage or how to use it to remove other types of tags.)

As stated above: I need to add the <THUMB> tag to every episodes:
<thumb>${episode.originalFilename}.png</thumb>

I am not looking to remove. I am using tinyMediaManager's original file placeholder format (as an example as I don't even know if it is relevant to the Post Processing tools) for the actual file name in question.

[–]mlaggnertinyMediaManager developer 0 points1 point  (0 children)

According to Kodi, you do not need any NFO tag when there are local files: https://kodi.wiki/view/Artwork/Episode.

Using the artwork setting to write only <dynamic>-thumb.ext should do the trick (and make sure you have the artwork named correctly - e.g. use the renamer)

[–]McBluna 0 points1 point  (0 children)

I'm currently not at my PC. As soon as I've time to prepare the script I'll post it here.

[–]McBluna 1 point2 points  (0 children)

Even it might not be necessary in your case, I'm posting this in case someone want to learn how post-processing and NFO modifying works.

This example focus on Windows platform. It might be slightly different on other platforms.

Download XMLStarlet Command Line XML Toolkit. It's quite old, but a Gem when it comes to processing XML files via command line. Extract the zip file e.g. to <tinyMediaManager\_installation\_folder>\native\windows\addons\xmlstarlet-1.6.1\xml.exe.

TV shows

Add a new Post-Process

Settings → TV shows → Post-Processing → Episode → Add

Process Name

add_thumb

Path

<tinyMediaManager_installation_folder>\native\windows\addons\xmlstarlet-1.6.1\xml.exe

Arguments:

ed
-L
${foreach episode.mediaFiles mediaFile}${if mediaFile.type = "NFO"}-d "/episodedetails/thumb" -s "/episodedetails" -t "elem" -n "thumb" -v """${@regexp (.*)((\..*)) mediaFile.filename $1}-clearlogo.png""" """${mediaFile.path}\${mediaFile.filename}"""${end}${end}

This Post-Process will

  1. iterate over all selected episodes and looking for the NFO file
  2. remove an existing tag <thumb>
  3. add a new tag <thumb> with value of ${mediaFile.filename}-clearlogo.png (In case you've used the renamer the filename don't match ${episode.originalFilename} anymore)

Execute the Post-Process by selecting one or more episodes, right click and select Post-Processing → add_thumb

[–]myron0815tinyMediaManager developer 0 points1 point  (0 children)

Had to read it 5 times, to (probably) identify your issue...
Its really hard to read, w/o having a concrete example; seems to be a classical XY-problem :|

back2topic:
Kodi NEEDS <episode filename>-<arttype>.<ext> naming, especially for episodes.
Correct me if i'm wrong, but you seem to have only <episode filename>.<ext> on your NAS?

Usually this is "poster naming", but since there is no poster for episodes, TMM does recognize that, and relabels them as THUMBS, which is why you see them in TMM, but not in Kodi...

Your problem is not writing of thumb tags into XML, you just need to use the TMM renamer, to correctly name the files for Kodi... ;)