Kodi Community Forum
WIP CommandLine - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+---- Forum: Ember Media Manager (https://forum.kodi.tv/forumdisplay.php?fid=195)
---- Thread: WIP CommandLine (/showthread.php?tid=228652)

Pages: 1 2 3 4 5 6 7 8 9


RE: CommandLine - redglory - 2019-06-05

My scripts are:

Radarr
Link

Sonarr
Link

os.environ.get('EmberMediaManager') is set to
D:\\EmberMediaManager\\Ember Media Manager.exe

My last log on Sonarr:
pythonw.exe at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
pythonw.exe at System.Windows.Forms.Control.WndProcException(Exception e)
pythonw.exe at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
pythonw.exe at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnUnhandledException(UnhandledExceptionEventArgs e)
pythonw.exe at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.raise_UnhandledException(Object sender, UnhandledExceptionEventArgs e)
pythonw.exe at Ember_Media_Manager.My.MyApplication.MyApplication_UnhandledException(Object sender, UnhandledExceptionEventArgs e)
pythonw.exe at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
pythonw.exe Unhandled Exception: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
pythonw.exe ERROR:EmberMediaManager:Ember Media Manager failed with: 255
pythonw.exe INFO:EmberMediaManager:Ember Media Manager: running on PID: (9716)
pythonw.exe INFO:EmberMediaManager:TV Show Internal ID: 128
pythonw.exe INFO:EmberMediaManager:TV Show TVDB ID: 253463
pythonw.exe INFO:EmberMediaManager:TV Show Full Path: T:\TV\Black Mirror
pythonw.exe INFO:EmberMediaManager:TV Show Title: Black Mirror
pythonw.exe INFO:EmberMediaManager:Starting Ember Media Manager with application arguments: ['D:\\EmberMediaManager\\Ember Media Manager.exe', u'-profile', u'redglory', u'-scanfolder', u'"T:\\TV\\Black Mirror"', u'-nowindow']
pythonw.exe INFO:EmberMediaManager:TV Show Black Mirror already on kodi's library. Scan folder for new episode.
pythonw.exe INFO:EmberMediaManager:Sonarr Ember Media Manager post-processing script started.

EDIT: while browsing my EMM log I saw this error at the same timestamp as previous python script:
Code:
2019-06-05 10:22:13.4798;Ember_Media_Manager.My.MyApplication;Ember_Media_Manager.My.MyApplication.MyApplication_Startup;1;INFO;====Ember Media Manager starting up====;
2019-06-05 10:22:13.5678;Ember_Media_Manager.My.MyApplication;Ember_Media_Manager.My.MyApplication.MyApplication_Startup;1;INFO;====Version 1.4.90 x64;
2019-06-05 10:22:19.7072;EmberAPI.Database;EmberAPI.Database.Connect_MyVideos;1;ERROR;Connect_MyVideos    Unable to open media database connection.;"EXCEPTION OCCURRED:System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
   at System.Data.SQLite.SQLite3.StaticIsInitialized()
   at System.Data.SQLite.SQLiteLog.Initialize()
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
   at EmberAPI.Database.Connect_MyVideos()*   at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
   at System.Data.SQLite.SQLite3.StaticIsInitialized()
   at System.Data.SQLite.SQLiteLog.Initialize()
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
   at EmberAPI.Database.Connect_MyVideos()"
2019-06-05 10:22:19.7322;Ember_Media_Manager.My.MyApplication;Ember_Media_Manager.My.MyApplication.MyApplication_UnhandledException;1;ERROR;EmberAPI;"EXCEPTION OCCURRED:System.NullReferenceException: Object reference not set to an instance of an object.
   at EmberAPI.Database.LoadAllGenres()
   at Ember_Media_Manager.frmMain.frmMain_Load(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)*   at EmberAPI.Database.LoadAllGenres()
   at Ember_Media_Manager.frmMain.frmMain_Load(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)"

Could this be the culprit?


RE: CommandLine - redglory - 2019-06-06

Finaly!

Googled a bit the problem and ended up copying 
Code:
SQLite.Interop.dll
from x64 folder to EMM root folder where the
Code:
Ember Media Manager.exe
is placed.

All is working now. 

Don't understand why it worked for movies scraping but it is working now Smile


RE: CommandLine - komplex - 2019-06-07

@redglory that issue has been around for about a year, not just a python problem https://forum.kodi.tv/showthread.php?tid=316733&pid=2732437#pid2732437


CommandLine - redglory - 2019-06-07

Ok thx.

Works for now


RE: CommandLine - DanCooper - 2019-06-07

That's strange, all DLL's will be indexed manually at the start and before the command line will be exequeted. I'ill check that, bug has been added to the tracker: Link


RE: CommandLine - redglory - 2019-07-30

(2019-06-07, 09:30)DanCooper Wrote: That's strange, all DLL's will be indexed manually at the start and before the command line will be exequeted. I'ill check that, bug has been added to the tracker: Link
I'm having same problem and I already have the file on the root of EmberMediaManager.exe

This only happens for tv shows...

I had to call my script using powershell script as on latest Sonarr version you can't no longer pass arguments...
python2w C:\ProgramData\Sonarr\scripts\EmberMediaManager\main.py

I can't even get anything on EMM logs.

If I run my script directly on powershell it calls it without a problem.
Image

Ran again with same error on Sonarr log file:
powershell.exe at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
powershell.exe at System.Windows.Forms.Control.WndProcException(Exception e)
powershell.exe at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
powershell.exe at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnUnhandledException(UnhandledExceptionEventArgs e)
powershell.exe at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.raise_UnhandledException(Object sender, UnhandledExceptionEventArgs e)
powershell.exe at Ember_Media_Manager.My.MyApplication.MyApplication_UnhandledException(Object sender, UnhandledExceptionEventArgs e)
powershell.exe at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
powershell.exe Unhandled Exception: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
powershell.exe ERROR:EmberMediaManager:Ember Media Manager failed with: -1073740771
powershell.exe INFO:EmberMediaManager:Ember Media Manager: running on PID: (15192)
powershell.exe INFO:EmberMediaManager:TV Show Internal ID: 149
powershell.exe INFO:EmberMediaManager:TV Show TVDB ID: 366026
powershell.exe INFO:EmberMediaManager:TV Show Full Path: T:\TV\Typewriter
powershell.exe INFO:EmberMediaManager:TV Show Title: Typewriter
powershell.exe INFO:EmberMediaManager:Starting Ember Media Manager with application arguments: ['C:\\ProgramData\\EmberMediaManager\\Ember Media Manager.exe', u'-profile', u'redglory', u'-scanfolder', u'"T:\\TV\\Typewriter"', u'-nowindow']
powershell.exe INFO:EmberMediaManager:TV Show Typewriter already on kodi's library. Scan folder for new episode.
powershell.exe INFO:EmberMediaManager:Sonarr Ember Media Manager post-processing script started.

My application folder
Image


RE: CommandLine - redglory - 2019-08-07

I've ended up creating executable python script and call it on Sonarr (created it with options: -w (No Console) -F (Onefile).

It works like a charm


RE: CommandLine - zerocool_ie - 2021-05-25

hey all,

I'm trying to work out the commandline switches to rescrape the thumb and nfo for a single episode only, but just cannot get it working.
I would like add automation into my daily script where I can tell Ember to rescrape episodes with missing thumb, plot, rating etc.
I'm hoping to extract strFilePath from SQLite into a text file, adding the correct switches.

has anyone done this before?
thanks Smile


RE: CommandLine - redglory - 2021-05-26

(2021-05-25, 16:23)zerocool_ie Wrote: hey all,

I'm trying to work out the commandline switches to rescrape the thumb and nfo for a single episode only, but just cannot get it working.
I would like add automation into my daily script where I can tell Ember to rescrape episodes with missing thumb, plot, rating etc.
I'm hoping to extract strFilePath from SQLite into a text file, adding the correct switches.

has anyone done this before?
thanks Smile
I don't think you can scrape a single episode. But better ask @DanCooper


RE: CommandLine - DanCooper - 2021-05-27

(2021-05-25, 16:23)zerocool_ie Wrote: I'm trying to work out the commandline switches to rescrape the thumb and nfo for a single episode only, but just cannot get it working.
It's not possible.
But I could add that if you specify a path to a movie/tvshow/episode, only that path will be scrapped. For example (same for all other types):
Code:
-scrapemovies [ScrapeType] single "D:\Movie\Avatar\Avatar.mkv" [ScrapeModifier]
Would that help?

For Ember 3.0 i've planned to implement a JSON interface like in Kodi to get the ID of a video to modify/scrape/whatever a video with this ID like you whould do in the GUI. But that takes time Big Grin


RE: CommandLine - zerocool_ie - 2021-05-28

(2021-05-27, 01:21)DanCooper Wrote:
(2021-05-25, 16:23)zerocool_ie Wrote: I'm trying to work out the commandline switches to rescrape the thumb and nfo for a single episode only, but just cannot get it working.
It's not possible.
But I could add that if you specify a path to a movie/tvshow/episode, only that path will be scrapped. For example (same for all other types):
Code:
-scrapemovies [ScrapeType] single "D:\Movie\Avatar\Avatar.mkv" [ScrapeModifier]
Would that help?

For Ember 3.0 i've planned to implement a JSON interface like in Kodi to get the ID of a video to modify/scrape/whatever a video with this ID like you whould do in the GUI. But that takes time Big Grin

thanks @redglory & @DanCooper 
That option would be great to have at some point down the line - I'm sure there are more important features you are working on Smile


This forum uses Lukasz Tkacz MyBB addons.