Closed novoid closed 4 years ago
I will take a look into this but first of all kodi module is broken at least in my tests... It complains about the imports (https://github.com/novoid/Memacs/blob/master/memacs/kodi.py#L10) which are different from the other modules. I guess problem was the restructuring between creating and merging this module, do you think it would be just fixed by adapting the imports?
I opened a pull request, making it work with the new import structure and orgformat library, will try to reproduce your problems
Ok I know what is the error, you're missing the argument --fieldnames
which tells the module whats in your csv file and --action_field
corresponds to the field which corresponds to the action so e.g.
PYTHONPATH=/home/vk/src/memacs /home/vk/src/memacs/bin/memacs_kodi.py \
-f ~/log/kodi/video.log \
--fieldnames timestamp,action,position,length,path,album,artist,title \
--action-field action \
--identification-fields title \
--minimal-pause-duration 15 \
--timestamp-field timestamp \
--output
Then the program runs through, right now it does not print out the entry but that's another issue I will investigate it does not output an entry yet because the log consists only of a start action and you need the corresponding end action to create an org entry.
I guess kodi should error out if mandatory arguments are not passed, maybe one should take the opportunity and exchange the args parsing with something like click which makes it very easy to create really nice cli tools-format
Awesome,
I can confirm that the following is producing the desired output to stdout:
PYTHONPATH=/home/vk/src/memacs /home/vk/src/memacs/bin/memacs_kodi.py \
-f ~/log/kodi/video.log \
--fieldnames timestamp,action,position,length,path,album,artist,title \
--action-field action \
--identification-fields title \
--minimal-pause-duration 15 \
--timestamp-field timestamp \
--output-format "{path}" \
-v
Most entries are perfect, except that pausing the playback for a few seconds causes an additional entry that messes up my agenda. But I understand the implications. I'll think about this and maybe a minimum pause setting could "smoothen" this a bit.
Hi @DerBeutlin,
I took a quick look at the very promising kodi logger module and I got an issue on my side. I'm not sure if I'm handling it wrong or if there is an issue with the code.
What I've got
Current kodi Memacs module and the first release of the kodi logger.
video.log
contains:What I start
I start the Memacs module manually:
Error
I then get:
I'd expect the module to produce Org mode output with the parsed and formatted content of the log.
Analysis
I debugged the situation. When I set a breakpoint at the corresponding line, I get:
To clarify, here is the list of keys:
So there is no
row['timestamp']
or similar. There seem to be values as keys. Is this because of my inability to understand the source code and use the module properly or is this a bug?Thanks!