mickle026 401 Posted January 28, 2023 Share Posted January 28, 2023 (edited) Updated 15 Sept 2023 - description at bottom of this post Updated 06 August 2023 - description at bottom of this post Updated 05 August 2023 - description at bottom of this post As requested, import and export .actors folders people as a seperate plugin. I have done this fairly quickly so have not extensively tested it/checked it all works falwlessly! Everything should log to its own files and keep out of Emby's main logs now If you don't know what it is or does then you don't need it! Use at your own risk, this plugin creates files (export) and changes Emby database (import) Create files writes to media folders and / or writes to metadata cache library Scheduled task * Updated 24/03/23 ===================== I have left the old version here incase the newer one doesn't work properly. I have NOT tested it! There is now an option to select the import metadata directory preference for \Metadata\library or \Metadata\people directories. Code has been added to change the path that the image is put to when the option is selected. Other than this change, both versions are the same (one with this change and one without) - no need to upgrade if you do not want to. Kodi_actors_Folders.zip Kodi_actors_Folders_(MetadataPeopleFolder).zip Updated 20 June 2023 Fixed Null Reference Exception when Actor image path is not null but an empty string - this shouldn't happen but seemingly can happen! When it occures the plugin simply exits, and doesnt finish its task. The Fix Now logs this as a path error and skips over it to continue so the plugin doesn't just quit and exit. Also a code edit for getting Images from http paths [ERROR - Debug Below] messages in your logs. Code to wait for the filesystem to actually save the temporary file to disk before trying to copy it & Exception Trace logging if it still fails. Logging made better for overwrite / do not overwrite destination instead of a error Logs should all go into the log directory on all systems now. If anyone still gets this null reference error, please let me know Kodi_actors_Folders(20-07-2023).zip * Updated & Reuploaded with Import changes to metadata path & option to write to a-z folders Kodi_actors_Folders(21-07-2023).zip Kodi_actors_Folders(21-07-2023) (2nd Release).zip 05 August 2023 * Fix for sporadic null reference error (caused by http.listener) - which stopped export. * Improved Invalid name handling * Added MovieList Export on activation * Added Timeframe option of people to export Kodi_actors_Folders (05-08-2023).zip 06 August 2023 * Added Error Traps for random export errors, recovers fully now,continues and logs (if selected). Kodi_actors_Folders (06-08-2023).zip 15 September 2023 * Added Import / Export of Provider ID stub files * Corrected settings that didn't save properly. This was done primarily for my own use, so it might not be ideal for everyone. Basically it allows you to export imdb,tmdb,tvmaze ids (currently just these three, I will add more provider ids later) with the poster images I have not tested the import yet but the code is there to do it... This is solely to help prevent duplicate people in my database and eventually make my db more and more correct over time, and also to work with my other plugins.... They are just plain text files with the provider id inside. Kodi_actors_Folders.zip Edited September 16, 2023 by mickle026 4 6 Link to comment Share on other sites More sharing options...
GrimReaper 3305 Posted January 28, 2023 Share Posted January 28, 2023 Oh thank you for this. Link to comment Share on other sites More sharing options...
GrimReaper 3305 Posted January 28, 2023 Share Posted January 28, 2023 Looks like if run from plugin settings>"Import missing only" triggers .actors(ALL)_Repair. If run from Scheduled tasks it correctly triggers .actors(MISSING)_Repair. Minor issue, just so you can be aware. Link to comment Share on other sites More sharing options...
mickle026 401 Posted January 28, 2023 Author Share Posted January 28, 2023 8 hours ago, GrimReaper said: Looks like if run from plugin settings>"Import missing only" triggers .actors(ALL)_Repair. If run from Scheduled tasks it correctly triggers .actors(MISSING)_Repair. Minor issue, just so you can be aware. Actually its running the missing only code, just reporting to the wrong log file, but thanks, I've fixed that, and added an export scheduled task too. Link to comment Share on other sites More sharing options...
GrimReaper 3305 Posted January 28, 2023 Share Posted January 28, 2023 (edited) 2 hours ago, mickle026 said: Actually its running the missing only code, just reporting to the wrong log file, but thanks, I've fixed that, and added an export scheduled task too. Dunno, as log was saying it's copying all images, starting with legendary Stan Lee, and timestamp confirmes that. Edited January 29, 2023 by GrimReaper Link to comment Share on other sites More sharing options...
mickle026 401 Posted January 28, 2023 Author Share Posted January 28, 2023 Aha gotya! Spotted an Error in the logic, it should be sorted (should be! - LOL) - re-uploaded. Im off to the pub now Thanks 1 Link to comment Share on other sites More sharing options...
mixXxim 2 Posted March 12, 2023 Share Posted March 12, 2023 @mickle026 Thank you for the great plugin. A tiny cosmetic thing maybe: According to the log, the images are correctly copied to the .actors folder, but the emby interface shows o copied folders. like I said just a little thing. Kind regards and many thanks Link to comment Share on other sites More sharing options...
mickle026 401 Posted March 14, 2023 Author Share Posted March 14, 2023 (edited) On 12/03/2023 at 10:38, mixXxim said: @mickle026 Thank you for the great plugin. A tiny cosmetic thing maybe: According to the log, the images are correctly copied to the .actors folder, but the emby interface shows o copied folders. like I said just a little thing. Kind regards and many thanks Thanks, Updated to fix this issue Logs them as well as reports them when finished. Edited March 15, 2023 by mickle026 1 Link to comment Share on other sites More sharing options...
tr0nllam 34 Posted March 23, 2023 Share Posted March 23, 2023 Is there anyway this plugin could be modified to copy the imported images into the metadata/people folders rather than the metadata/library folder? In the current format, you have to re-import the images if you ever want to move the images to a new database rather than just being able to copy the metadata/people folder over. Link to comment Share on other sites More sharing options...
mickle026 401 Posted March 24, 2023 Author Share Posted March 24, 2023 16 hours ago, tr0nllam said: Is there anyway this plugin could be modified to copy the imported images into the metadata/people folders rather than the metadata/library folder? In the current format, you have to re-import the images if you ever want to move the images to a new database rather than just being able to copy the metadata/people folder over. Yes that is entirely possible, I'll add it to my 'todo' list. Link to comment Share on other sites More sharing options...
mickle026 401 Posted March 24, 2023 Author Share Posted March 24, 2023 @tr0nllamA new version has been added to the first post with your request implimented. It is untested!!!!! Kodi_actors_Folders_(MetadataPeopleFolder).zip Link to comment Share on other sites More sharing options...
sydlexius 243 Posted March 25, 2023 Share Posted March 25, 2023 @mickle026Would it be possible in a future enhancement to make sure that when "Log the Operation to file" is selected, that the log entries go into the logs folder? Link to comment Share on other sites More sharing options...
mickle026 401 Posted March 25, 2023 Author Share Posted March 25, 2023 (edited) 1 hour ago, sydlexius said: @mickle026Would it be possible in a future enhancement to make sure that when "Log the Operation to file" is selected, that the log entries go into the logs folder? Where are they going on your system (and what type of system is it) ? - I was not aware that they were not on anyones systems... Edited March 25, 2023 by mickle026 Link to comment Share on other sites More sharing options...
sydlexius 243 Posted March 25, 2023 Share Posted March 25, 2023 46 minutes ago, mickle026 said: Where are they going on your system (and what type of system is it) ? - I was not aware that they were not on anyones systems... I run Emby in a docker container, and the log files are going into the /config path, not /config/logs. Your other Actors plugins have worked in the past (though some of the tasks outputted log file names with leading spaces). Link to comment Share on other sites More sharing options...
tr0nllam 34 Posted March 25, 2023 Share Posted March 25, 2023 (edited) On 3/24/2023 at 3:52 PM, mickle026 said: @tr0nllamA new version has been added to the first post with your request implimented. It is untested!!!!! Kodi_actors_Folders_(MetadataPeopleFolder).zip The new version is copying images to "programdata\metadata\metadata\library\people\Actor Name\folder.jpg" when it should be "programdata\metadata\people\Actor Name-tmdb-xxxxxxx\folder.jpg" For the new method to work, the plugin needs to know the proper providerID to add to the folder. The tmdb id is the default folder id, but it also accepts imdb id if there is no tmdb id available. I don't know how difficult that is to implement. Edited March 25, 2023 by tr0nllam Link to comment Share on other sites More sharing options...
mickle026 401 Posted March 26, 2023 Author Share Posted March 26, 2023 On 25/03/2023 at 04:13, sydlexius said: I run Emby in a docker container, and the log files are going into the /config path, not /config/logs. Your other Actors plugins have worked in the past (though some of the tasks outputted log file names with leading spaces). I don't see any reason for the incorrect log paths, I have not decided the path on my own string its embys own log path. My Plugin uses Embys internally assigned Logpath and appends the filename to it. string LogPath = Current.configurationManager.ApplicationPaths.LogDirectoryPath; string MyLog = Path.Combine(LogPath, ReportName + ".txt"); log.KodiFolder_ioLogging(MyLog, DateTime.Now.ToString("dd.MMM.yyy - HH'.'mm'.'ss") + $" The Logging Text"); log.KodiFolder_ioLogging(filename,string to write); 17 hours ago, tr0nllam said: The new version is copying images to "programdata\metadata\metadata\library\people\Actor Name\folder.jpg" when it should be "programdata\metadata\people\Actor Name-tmdb-xxxxxxx\folder.jpg" For the new method to work, the plugin needs to know the proper providerID to add to the folder. The tmdb id is the default folder id, but it also accepts imdb id if there is no tmdb id available. I don't know how difficult that is to implement. I'll look at this when I have time. Link to comment Share on other sites More sharing options...
mickle026 401 Posted March 27, 2023 Author Share Posted March 27, 2023 On 25/03/2023 at 04:13, sydlexius said: I run Emby in a docker container, and the log files are going into the /config path, not /config/logs. Your other Actors plugins have worked in the past (though some of the tasks outputted log file names with leading spaces). Found one instance where its doing it for a Export Actors to '.actors' scheduled task, I have fixed that so I'll update it for next release - thanks. Link to comment Share on other sites More sharing options...
mickle026 401 Posted July 20, 2023 Author Share Posted July 20, 2023 Updated 20 June 2023 - See First post for description of fixes 2 Link to comment Share on other sites More sharing options...
tr0nllam 34 Posted July 21, 2023 Share Posted July 21, 2023 23 hours ago, mickle026 said: Updated 20 June 2023 - See First post for description of fixes Did you ever figure out of it's possible to copy the imported files to the default people folder (programdata\metadata\people\Actor Name-tmdb-xxxxxxx\folder.jpg)? I noticed the new version is still using "programdata\metadata\library\people\Actor Name\folder.jpg" rather than adding the tmdbid or imdbid to the folder and putting it where the others are. Link to comment Share on other sites More sharing options...
mickle026 401 Posted July 21, 2023 Author Share Posted July 21, 2023 the option is in the config to write to the people folder I coded that way back when .... I couldnt remember off hand if it added the tmdb bit to the folder, but it puts them in the people folder Quote (programdata\metadata\people\Actor Name-tmdb-xxxxxxx\folder.jpg)? it definately put them here programdata\metadata\people\Actor Name\folder.jpg and writes the folder.jpg file if the option is checked Anyway .......... I just checked and it didnt add the tmbd id so I just coded it in to do that if it exists now it'll write like this in priority order of tmdb, imdb, tvmaze programdata\metadata\people\Actor Name-tmdb-xxxxxxx\folder.jpg programdata\metadata\people\Actor Name-imdb-xxxxxxx\folder.jpg programdata\metadata\people\Actor Name-tvmaze-xxxxxxx\folder.jpg and fallback to programdata\metadata\people\Actor Name\folder.jpg if no provider id's are available I also added a fix to invalid http urls errors that the previous fixes highlighted.. I'll re-upload now Link to comment Share on other sites More sharing options...
tr0nllam 34 Posted July 21, 2023 Share Posted July 21, 2023 (edited) 14 minutes ago, mickle026 said: the option is in the config to write to the people folder I coded that way back when .... I couldnt remember off hand if it added the tmdb bit to the folder, but it puts them in the people folder it definately put them here programdata\metadata\people\Actor Name\folder.jpg and writes the folder.jpg file if the option is checked Anyway .......... I just checked and it didnt add the tmbd id so I just coded it in to do that if it exists now it'll write like this in priority order of tmdb, imdb, tvmaze programdata\metadata\people\Actor Name-tmdb-xxxxxxx\folder.jpg programdata\metadata\people\Actor Name-imdb-xxxxxxx\folder.jpg programdata\metadata\people\Actor Name-tvmaze-xxxxxxx\folder.jpg and fallback to programdata\metadata\people\Actor Name\folder.jpg if no provider id's are available I also added a fix to invalid http urls errors that the previous fixes highlighted.. I'll re-upload now I have that option checked and it was still sending them to metadata\library\people\ instead of metadata\people. Maybe it has something to do with what my library path is set at in the Emby options. I'll test it out on the new version. EDIT: It's correctly adding the ids to the folder in the newest version, but it's still putting them in the metadata\library\people folder instead of metadata\people. What do you have your Emby metadata path set at? Mine is listed as "C:\Users\xxx\AppData\Roaming\Emby-Server\programdata\metadata" Edited July 21, 2023 by tr0nllam Updated Information Link to comment Share on other sites More sharing options...
tr0nllam 34 Posted July 21, 2023 Share Posted July 21, 2023 I created a new Emby server to test it and this is what I've found: If you choose "Use .actors Images (All Images)" from the plugin options, it imports images to "programdata\metadata\library\people" If you choose "Use .actors Images (Missing Images ONLY)" from the plugin options, it imports images to "programdata\metadata\metadata\library\people" If you choose "Import Actors from .actors - missing only" from Scheduled tasks, it imports images to "programdata\metadata\library\people" So, for me, none of the actor import options send them to the correct directory. Also, I'm not sure if it's related, but I've also noticed that if you're using the default metadata directory, Emby won't write it to system.xml file, so it's impossible to change unless you manually edit it. Link to comment Share on other sites More sharing options...
mickle026 401 Posted July 21, 2023 Author Share Posted July 21, 2023 OK, I see the problem with the metadata paths. Thanks for the information @tr0nllam I have made the necessary edits and rebuilt/re-uploaded it. It seems to be working correctly here, let me know if its right for you too.....as I use a custom path of my choice rather than the internal one. Link to comment Share on other sites More sharing options...
tr0nllam 34 Posted July 21, 2023 Share Posted July 21, 2023 (edited) 54 minutes ago, mickle026 said: OK, I see the problem with the metadata paths. Thanks for the information @tr0nllam I have made the necessary edits and rebuilt/re-uploaded it. It seems to be working correctly here, let me know if its right for you too.....as I use a custom path of my choice rather than the internal one. The two .actors tasks in the plugin options are now sending to the proper people folder, however, I just realized that they're sending all the people to the same directory rather than using a-z folders like Emby does. So, instead of "programdata\metadata\people\Adam Bellamy-imdb-nm7708400" it should be "programdata\metadata\people\a\Adam Bellamy-imdb-nm7708400." Also, The Scheduled Tasks missing actors task is still sending to the "programdata\metadata\library\metadata\people" path rather than the newer one. Edited July 21, 2023 by tr0nllam Link to comment Share on other sites More sharing options...
GrimReaper 3305 Posted July 21, 2023 Share Posted July 21, 2023 (edited) 1 hour ago, tr0nllam said: I just realized that they're sending all the people to the same directory rather than using a-z folders like Emby does. So, instead of "programdata\metadata\people\Adam Bellamy-imdb-nm7708400" it should be "programdata\metadata\people\a\Adam Bellamy-imdb-nm7708400." That depends on the installation, Emby also does alphabet folderless. Edited July 21, 2023 by GrimReaper Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now