Linux - set custom category for path

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
zosky Offline
Donor
Posts: 304
Joined: Dec 2008
Reputation: 1
Location: toronto. canada
Post: #1
hi yall.

i have a ton of "hollywood" TV, documentories, anime & home movies in my library... my TV list ends up being MASSIVE, & useless. i found a way around this using a combination of smartPlaylists & categories... this bash script exports a list of all shows that have "anime" in the path & all shows in the anime category ... the difference (anime without the anime category) is updated

are there other (better) solutions to do this ?
xwmm is amazing for editing single items
(it does not do anything in bulk)

maybe this will tickle some1 (smarter then i)
and we can see this in an add-on ?

cheers
~ z

Code:
#/bin/bash
# xbmc anime catogrizer

mysqlCMD="-uxbmc -pxbmc xbmcvid60"

## list all anime in anime DIR by showID
ALL=$(mysql -e "SELECT tvshowlinkpath.idShow
      FROM path, tvshowlinkpath, tvshow
      WHERE path.strPath LIKE \"%anime%\"
      AND tvshowlinkpath.idPath = path.idPath
      AND tvshow.idShow = tvshowlinkpath.idShow" $mysqlCMD|sort )

## list all anime in anime CAT by showID
ANI=$(mysql -e "SELECT idShow
        FROM genrelinktvshow WHERE idGenre = 57" $mysqlCMD|sort )

## COMMpare both lists & output NEW
# (unique to file1 / ALL w/o CAT=Anime)
NEW=$(comm -23 <(echo "$ALL") <(echo "$ANI"))

## IF SOMETHING IS NEW ... UPDATE THE DB
[[ "$NEW" ]] && {
      for newID in $NEW; do
      mysql -e "INSERT INTO genrelinktvshow (idGenre, idShow)
            VALUES (\"57\", \"$newID\")" $mysqlCMD
      done
      echo "set CAT anime for $(echo "$NEW"|wc -l) new shows"
    }

eight xbmc devices mostly openElec
atom/ion | iphone4 | hpTouchPad | raspberryPI ...
central mySQL db ( +20TB NAS ) +maraschino +IRtoy.v2 +yatse
[Image: widget]
(This post was last modified: 2012-04-04 06:31 by zosky.)
find quote
DaMizZa Offline
Senior Member
Posts: 110
Joined: Dec 2010
Reputation: 2
Location: Saskatchewan, Canada
Post: #2
There is... I just set it up the other day and so far it's working beautifully. Check out this thread for a well-written up tutorial on the topic:

http://forum.xbmc.org/showthread.php?tid=89678

XBMCbuntu {Frodo} - Ubuntu 12.04 (Main):
Intel Q6600 [2.4GHz Quad Core], 4GB DDR3, nVidia GT-210, Antec Fusion Case (iMon LCD), PS3 BD Remote

XBMC Live {Frodo} - Ubuntu 10.04 (Bedroom): Intel Atom D510 [1.66GHz Dual Core], ION Graphics, 2GB DDR2, PS3 BD Remote
find quote