Comment cataloguer automatiquement les dvd, en les mettant l'un après l'autre dans le lecteur, et créer une liste au format csv prête à l'import par antmovie catalog ?
Vous en rêviez ? Je l'ai fait... lol
Voici le code en basic.
Il tourne avec justbasic (freeware)
Il vous demande le 1er numéro de dvd à cataloguer
Il vous demande de l'insérer
Il le lit, vous propose la correction quasi automatique des noms
Enregistre dans un fichier csv
et passe au suivant
Voici le code (si vous trouvez ça pratique un petit merci sera le bienvenu à jl.mavaut@aliceadsl.fr)
'***************************************************************************
'*** CATALOGUER LES DVD POUR ANTMOVIE CATALOG ***
'***************************************************************************
dim arrayName$(10, 10)
files pathSpec$, arrayName$()
dim info$(10, 10)
[debut]
'Il faut bien commencer quelque part ...
cls
Print "Entrez le numéro du 1er dvd à cataloguer : ";
input f
'On controle le format du numero de dvd
'Mes ref dvd sont au format Fxxxx
'Mais vous pouvez mettre ce que vous voulez
if f<1 then goto [debut]
if f>=1 and f<=9 then f$="F000"+str$(f)
if f>=10 and f<=99 then f$="F00"+str$(f)
if f>=100 and f<=999 then f$="F0"+str$(f)
if f>=1000 and f<=9999 then f$="F"+str$(f)
if f>9999 then goto [debut]
[litdvd]
cls
print "Disque ";f$,
'Mon lecteur dvd est en F:
'Changez pour mettre votre lettre
files "F:\", info$()
if val(info$(0, 0))=0 then goto [paspret]
print info$(0, 0);" fichiers"
print
"=================================================================================="
fic = val(info$(0, 0))
for i = 1 to fic
nom$ = info$(i, 0)
memoire$ = nom$
'Traitement du nom de fichier ------------------------------
'On commence par enlever les caracteres indesirables
point$=""
new$=""
for j = 1 to len(nom$)
point$ = mid$(nom$,j,1)
if point$="_" then point$=" "
if point$="-" then point$=" "
if point$="." then point$=" "
new$=new$ + point$
next j
nom$=new$
'Ensuite on passe l'initiale en majuscule et le reste en minuscules
initial$ = Upper$(Left$(nom$,1))
reste$ = Lower$(Right$(nom$, Len(nom$)-1))
nom$ = initial$;reste$
'Ensuite on epure au maximum
position=0
position = instr(nom$, "french")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, " fr ")
if position <> 0 then nom$ = left$(nom$,position-1)
position=0
position = instr(nom$, "dvdrip")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "xvid")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, " vo ")
if position <> 0 then nom$ = left$(nom$,position-1)
position=0
position = instr(nom$, " avi")
if position <> 0 then nom$ = left$(nom$,position-1)
position=0
position = instr(nom$, "divx")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "(")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "{")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "[")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, " vf ")
if position <> 0 then nom$ = left$(nom$,position-1)
position=0
position = instr(nom$, "vraie vf")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "unrated")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "dvd rip")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "stv")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "hdtv")
if position <> 0 then nom$ = left$(nom$,position-2)
position=0
position = instr(nom$, "tvrip")
if position <> 0 then nom$ = left$(nom$,position-2)
response$ = nom$
message$ = memoire$;chr$(13);"Voulez-vous changer ce titre en ..."
prompt message$; response$
nom$=response$
if response$="" then nom$=memoire$
taille$ =int((val(info$(i, 1)))/1024);" Ko"
v$ = nom$;";";taille$
new$=f$+";"+v$
print v$
'Mon fichier csv à importer est à la racine de D:
'A vous de modifier si vous voulez le mettre à un autre endroit
'Le coté pratique du aapend c'est que si le fichier
'n'existe pas il le créera
open "d:\newliste.csv" for append as #f
print #f, new$
close #f
next i
print
"=================================================================================="
print
f=f+1
'On controle le format du numero de dvd
if f>=1 and f<=9 then f$="F000"+str$(f)
if f>=10 and f<=99 then f$="F00"+str$(f)
if f>=100 and f<=999 then f$="F0"+str$(f)
if f>=1000 and f<=9999 then f$="F"+str$(f)
print "inserez le dvd ";f$;" et appuyez sur la touche 'Entrée'"
print "ou tapez 'fin' pour arreter ";
input r$
if r$="fin" then end
if r$ ="FIN" then end
print
print
"=================================================================================="
goto [litdvd]
end
[paspret]
print "dvd pas pret ...."
print "inserez le dvd et appuyez sur la touche 'Entrée'"
input r$
if r$="fin" then end
if r$ ="FIN" then end
goto [litdvd]