• Index
  •  » Cafe
  •  » scan directory to add movies automatically

#1 2009-06-20 21:24:20

New member
Registered: 2009-06-20
Posts: 2

scan directory to add movies automatically


First of all: I'm really new here, so please feel free to move this post to any other section, where it fits better.

Since I did not start a movie collection for a long time, because it was too time-consuming to type in all movie titles in gcstar, I wrote a small shell script, which does this job. I do not know if there is any feature in gcstar for this, but I could not find any searching gcstar and the internet. If there is, please let me know smile

parse_movies.sh FILENAME MAXID
FILENAME is the name of the gcstar file
MAXID is the maximum ID number (I guess sth like element count, but I leave it blank all the time and it works fine...)

The script just adds for each .avi file in the directory in which it will be run, one entry. It adds the title, the link to the movie file and sets the location to HDD.
So basically the "catch movie information" must be done by hand afterwards.
And special characters like '&' will not work in movie names.

Hope you like it wink
Thanks for the nice work of gcstar,

--- edit: ---
I saw, that only logged in users can see the attachment, so i decided to paste it into this post...


# use at own risk

# usage: parse_videos.sh OUTPUTFILE MAXID

count=0                            # set counter

echo '<?xml version="1.0" encoding="UTF-8"?>' >> $1
echo '<collection type="GCfilms" items="1" version="1.4.3">' >> $1
echo  '<information>' >> $1
echo   '<maxId>'$2'</maxId>' >> $1
echo  '</information>' >> $1

for i in *.avi;
echo processing $i

echo '<item'>> $1
echo ' id="'$count'"'>> $1
echo ' title="'$name'"'>> $1
echo ' date=""'>> $1
echo ' time=""'>> $1
echo ' director=""'>> $1
echo ' country=""'>> $1
echo ' genre=",,,"'>> $1
echo ' image=""'>> $1
echo ' backpic=""'>> $1
echo ' actors=""'>> $1
echo ' original=""'>> $1
echo ' webPage=""'>> $1
echo ' seen="0"'>> $1
echo ' added="20/06/2009"'>> $1
echo ' region=""'>> $1
echo ' format="HDD"'>> $1
echo ' number="1"'>> $1
echo ' identifier="0"'>> $1
echo ' place=""'>> $1
echo ' rating="0"'>> $1
echo ' audio=""'>> $1
echo ' subt=""'>> $1
echo ' age=""'>> $1
echo ' video=""'>> $1
echo ' serie=""'>> $1
echo ' rank=""'>> $1
echo ' trailer="'$path'/'$i'"'>> $1
echo ' borrower="none"'>> $1
echo ' lendDate=""'>> $1
echo ' borrowings=""'>> $1
echo ' favourite="0"'>> $1
echo ' tags=""'>> $1
echo '>'>> $1
echo '<synopsis></synopsis>'>> $1
echo ' <comment></comment>'>> $1
echo '</item>'>> $1

count=`expr $count + 1`        # Increment the counter

echo '</collection>'>> $1

Last edited by yo-chen (2009-06-20 23:49:43)



#2 2009-06-21 00:24:08

From: ...
Registered: 2008-10-27
Posts: 59

Re: scan directory to add movies automatically

Hi yo-chen;

do you know the ImportFolder functionnality ?
I think you really need to test it, even more to test its last improvement from the svn.

See post http://forums.gcstar.org/viewtopic.php?id=903.

Have fun with GCstar





#3 2009-06-21 01:16:21

New member
Registered: 2009-06-20
Posts: 2

Re: scan directory to add movies automatically

Hi Bubblegum,

that sounds great smile Thanks, I will try it in the near future




#4 2010-03-09 08:34:52

New member
Registered: 2010-03-05
Posts: 7

Re: scan directory to add movies automatically

It really sounds interesting and informative post,right method which can help in a very effective way to do what we wish and desire regarding valuable knowledge.Thanks.


  • Index
  •  » Cafe
  •  » scan directory to add movies automatically

Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.