Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Custom Mover for XBMC

Featured Replies

I built a custom mover script for my XBMC library so that I could keep everything except the movie files located on the cache drive.  The reason is that I use a lot of .nfo, .tbn, .jpg files and .actors, extrafanart and extrathumbs folders.  Because of these files and folders every time I would browse the XBMC library every drive in unRAID would spin up and I wanted to only spin up a drive when I was watching a video from that drive.

 

The problem I have is that I want to use the cache drive for my other shares such as one called Family Pictures and Movies which also has .jpg files in it.  I have been trying to figure out how to keep the XBMC library files on the cache drive while being able to move the other files into the array but can't just get there.

 

For my current mover I am excluding file types and was hoping that I could invoke either a second mover to skip the library folder, or better yet add and addition section to my current mover so that it would move all shares except the XBMC library and then move only the movie files from the XBMC library.

 

My current mover has the following lines to split the XBMC library between the cache drive and the array, the missing step would be to add a second section that would move all of the shares except my XBMC library share.

 

if [ -d "/mnt/user0/$Share" ];

then

 

    echo "moving $Share"

 

    find "./$Share" -depth \( \( -type f ! -exec fuser -s {} \; ! -iname "*.jpg" ! -iname "*.png" ! -iname "*.tbn" ! -iname "*.nfo" ! -iname "*.jpeg" ! -iname "*.txt" \) -o \( -type d -empty \) \) -print \

 

      -exec rsync -i -dIWRpEAXogtO --numeric-ids --inplace {} /mnt/user0/ \; -delete

 

  else

 

    echo "skipping $Share"

 

  fi

 

done

 

rm /var/run/mover.pid

echo "mover finished"

 

Thanks for any help on this.

 

Rather than a custom mover couldn't you do the following?:

 

Setup your XBMC folder as "Cache Only" then manually move just the movie files to your array under a folder with the same path as your Cache Only folder.  Then the existing mover would skip the "Cache Only" folder but you would be accessing your movie files from an array drive.  Note you might want to backup your metadata to an archive on the array periodically anyway unless it is easy to get back again if your cache drive fails.

 

And I am asking a question as I don't know if this idea would cause problems or not.

Why not keep the metadata files on the same drive as the movie file?

  • Author

I use another cron job with a bash file to backup all files on the cache drive each night so am not worried about that right now.

 

I do not think I can have one share on the cache drive and one in the array with the same name.  If I want XBMC to see all the extra files with the movie files it must see them in the same folder structure.  This is what one of my folders looks like...only the Resident Evil (2002).mp4 file gets moved to the array and everything else stays on the cache drive.

 

\\tower\XBMCLibrary

.actors

extrafanart

extrathumbs

banner.jpg

clearart.png

folder.jpg

logo.png

Resident Evil (2002).mp4

Resident Evil (2002).nfo

Resident Evil (2002).tbn

Resident Evil (2002)-fanart.jpg

Resident Evil (2002)-poster.jpg

 

The reason I started using the custom mover was to split the metadata files from the movies so when I browse my library with XBMC it does not spin up every drive in my array simply so I can see my custom fanart.

I guess I'm lame. I just use cache_dirs

When my Machine or machines spin up they scan their libraries looking for changes. If nothing is changed they don't spin up any drives. If there are changes they download them from the server and update their libraries and its all well.

  • Author

BobPhoenix

 

So I missed the whole cache only share for a few minutes, but once I figured out what you were saying in full I decided to try it.

 

I created a share called test as a cache only share.

I also created the test folder on two of the array drives.

 

I copied files into the share \\tower\test and \\tower\disk4\test

 

If I browse the share I see all the files.

 

If I run the original mover I get a lot of the following (one for every file I would want to keep on the cache drive and the mover is very slow like this),

 

moving test/

./test/Little Trip.mp3

>f+++++++++ test/Little Trip.mp3

rsync: open "/mnt/user0/test/Little Trip.mp3" failed: No space left on device (28)

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7]

mover finished

 

It does work, the files on the cache drive stay in place and the ones on the array stay also, but I think there would be around 10000 of these error every time the mover ran which would not make for a happy array :)

 

Still think I need to find a way to add to the custom mover so I don't through all the errors but thanks for the suggestion as it does work just not right for me

 

  • Author

kizer,

 

I use cache_dirs as well, but that actually does not solve this issue as it keeps the pointer (directory entries) and updates to those pointers in cache for quicker searching, it does not keep the actual files which is why I keep them all on the cache drive.

 

If I move all the files to the array with only cache_dirs than when I browse through XBMC it will know quickly where the file is in the array but still spin up every drive so it can open those files, I only want to spin the cache drive unless I decide to play an actual video.

 

Thanks for the feedback though

Wouldn't a central MySQL xbmc db on your unraid box solve this ?

  • Author

dalben,

 

I use a centralized database which does work for some things.  But I also use my XBMC library for PLEX (my in-laws), Windows Media Player and older versions of XBMC that cannot share the current database.

 

Also if you are use to using .nfo files and use them to do things like create multiple sets for movies or have local art to use rather than the standard art for a movie or tv show than the central database does not cover those things.  The .nfo files are read by XBMC before any information in the database and currently there is no way as easy as using .nfo files to have a movie in more than one set in the database itself.

 

I also use .nfo files to point to different scrappers in XBMC.  Although most of my videos are English I also have German, French, Russian and Japanese and the .nfo files override the current scrapper and scrape from scrappers for the right region.

 

Thanks for the help

You certainly know how to drive XBMC better than I do.  I'll leave you to it but watch this thread with interest as it sounds like I could learn a thing or two

  • Author

dalben,

 

It's amazing what you will learn to do so you don't have to hear everyone whine about how it does not work for them...with 4 kids and 9 sets of in-laws around here all the time I am thinking of hiring a help desk person so I can go back and play with my systems :)

 

Come to think of it that's why I moving off my SAN and to my unRAID systems, more play time:)

 

Thanks for the comments

BobPhoenix

 

So I missed the whole cache only share for a few minutes, but once I figured out what you were saying in full I decided to try it.

 

I created a share called test as a cache only share.

I also created the test folder on two of the array drives.

 

I copied files into the share \\tower\test and \\tower\disk4\test

 

If I browse the share I see all the files.

 

If I run the original mover I get a lot of the following (one for every file I would want to keep on the cache drive and the mover is very slow like this),

 

moving test/

./test/Little Trip.mp3

>f+++++++++ test/Little Trip.mp3

rsync: open "/mnt/user0/test/Little Trip.mp3" failed: No space left on device (28)

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7]

mover finished

 

It does work, the files on the cache drive stay in place and the ones on the array stay also, but I think there would be around 10000 of these error every time the mover ran which would not make for a happy array :)

 

Still think I need to find a way to add to the custom mover so I don't through all the errors but thanks for the suggestion as it does work just not right for me

Ask Tom to change the mover script so it doesn't log them or more importantly it should skip any looking at a "Cache Only" folder in the first place.  Because to me it sounds like it is NOT skipping the folder just not moving the files.  I would have thought it would skip the folder from any processing at all personally.  But maybe it does and something else is going on here.  But what I said is what it sounds like it is doing in my opinion.  It is possible someone else has already modified the mover to not log them but if I remember correctly it may only be working for folders beginning with a ".".  And that is not the standard procedure for cache only shares any more.
  • Author

BobPhoenix,

 

Sorry about the delay, out of town for a couple of weeks so am not really looking at this right now.  I would agree with you though, if I could simply skip the logging of the cache only share this would solve everything and be a perfect solution for what I am looking to get accomplished.

 

Will get back to this once I am back at home.

 

Thanks for the help !!!

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.