Any thoughts on an option to auto-remove files from watched series?
#1
Lightbulb 
Hi all,

I am peeking around in the XMBC source, I can build and debug it well. I want to see if I can make something to (auto) remove the files that belong to the episode I watched. The reason is that I have a limited disk space, and after I've seen the episode (let's say it ends and returns to the XBMC window) I would like that file moved to a "seen" folder so that I can remove it later. Right now I need to remember which episodes I watched and delete them by hand later.

Any pointers to how this can be done elegantly? I was thinking in finding the exact event that XBMC returns after playing a file, and then perform the move. I am still learning to find my way around the source so maybe there is a more elegant way?

With regards,
- Jorgen
Reply
#2
Ok, I guess nobody can provide me with an answer on this short notice. I think I will try to do the following.

When the update database function is called (invoked at the beginning of XMBC or manually) I will try to move all watched series to a subdir called "seen". When I am succesful in this, I will come back and ask some more questions on how to make this configurable or maybe provide a patch for it.

This handle seems to be the best, as it belongs to the database update functionality, and there is no user interaction required..

With regards,
- Jorgen
Reply
#3
i assume you have figured it out but the code you are looking for is sitting in CVideoDatabase::CleanDatabase(). note that you will not be able to keep those episodes listed in the db any longer (i assume this isnt something you'd want anyways).

finally, irc is a much better medium for involved questions Smile
Reply
#4
Thanks a lot for the pointers! Didn't knew about IRC I will have to find myself a rusty old IRC client I used in the old days and subscribe when I need to know more ;-)

Thanks again!
- Jorgen
Reply
#5
So you looking to implementing some kind of "Recently Watched" / "Recently Viewed" history feature in XBMC then? I do not like the sound of XBMC automatically deleting or moving a users files, that is way too dangerous for a GUI setting.

IRC: http://wiki.xbmc.org/?title=Appendix_D:_...ct_methods

PS! You know that in the settings you can enable deleting of files from the context-menu, right?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#6
if that wasn't clear; such a diff would never be accepted in svn. but personal mods is ofc welcome.
Reply
#7
Hi all,

What would be the most user friendly of course is making a seperate view where all recent played series are shown, and with some checkbox mechanism these attached files can be removed or moved from disk so that the user is always in charge of what needs to be deleted. However I looked into the engine and something like that requires much work as it is a new view, the skins that are out there probably don't support it.

For my own purposes I would settle with a simple move of all files with the extension .avi, .divx, .mpeg, .mkv etc from the dir {some series} to {some series}/seen if the flag is set that they are watched. I do not keep old watched episodes, but I understand that automatic moving might not be desirable, and maybe even a setting per folder.

Trying to do this for myself for example in changing the auto update mechanism for the DB to (re)move my watched series, that's the cheapest effort in coding. Another way maybe is a plugin that does that for me, but although I know python I can't find enough documentation on how the plugin mechanism works, and debugging in C++ seemed more friendly and direct. But who knows maybe a plugin is a better idea, I am not even sure if that is possible in a plugin..

If there are better ways or angles on how to tackle this in a more generic and acceptable way I am all open to suggestions. I am recovering from being ill the holidays (just my luck) so I will probably first start some investigative work and see if I can do what I want, but if I can contribute something that more users like, that would be better. I have had so much pleasure from XBMC back in my XBox times, and now on my Vista HTPC that it would be nice to try to help out ;-)

With regards,
- Jorgen
Reply
#8
well, to have a recently watched feature, "all" that is needed is storing the playdates in the db. the rest is just a .xsp

personally i dont see what file management has to do in a video library but that's just me
Reply
#9
I'm guessing he needs to be able to see in the file system which episodes he has watched to be able to delete them there. A DB-flag would just indicate to XBMC that the episode has been watched.

Maybe there could be a function in XBMC which you could call by clicking a menu item somewhere which looks for episodes with the "Watched"-flag set, and removes them both from DB and file system?

EDIT: After more thoughts, maybe this would be a solution:

The user gets a question after a episode has been watched (could be optional through setting): "Do you want to tag this episode for deletion?". The tagged episodes could later be deleted either by a timer job or through menu choice by user. Alternatively, there could be a question for the whole season when the last episode in the season has been watched (maybe just "You've watched the whole season. Do you want to delete it?").

Just some thoughts about what I would find useful.
Reply
#10
that is really the job for a script imo. if anything is missing to realize it i'll gladly add the missing bits.
Reply
#11
I just started using the library for shows and this would really help me out getting rid of episodes I have watched.
Are you aware of any scripts that will take care of this?
Reply
#12
Did this idea die off completely, shame, kind of liked it. Would be very useful to have some kind of automatic(optional) deletion of recently watched tv shows.
Reply
#13
this can be done in an add-on. nothing i'd consider in the core.
Reply
#14
spiff Wrote:this can be done in an add-on. nothing i'd consider in the core.

Does such an add-on exist? I'd be fine with recently watched list where I could periodically and manually delete the content I don't want to keep, but auto-delete would be ok also.
Reply
#15
http://forum.xbmc.org/showthread.php?tid=75457

I'm using it on darma beta3. You have to go to programs / program addons to run it manually. There is no autorun.

i use this addons.xml:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.autocleaner"
       name="autocleaner script"
       version="1.0.0"
       provider-name="midna">
  <requires>
    <import addon="xbmc.python" version="1.0"/>
  </requires>
  <extension point="xbmc.python.script"
             library="default.py" />
  <extension point="xbmc.addon.metadata">
    <platform>all</platform>
    <minversion>30369</minversion>
    <summary>autocleaner script</summary>
    <description>clean watched eps</description>
  </extension>
</addon>

I didn't understand why it should leave the last ep so I changed:
if epcount > 1:
to
if epcount > 0:
Reply

Logout Mark Read Team Forum Stats Members Help
Any thoughts on an option to auto-remove files from watched series?1