Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Popcorn Movie Catalog (v1.0.4) - An unfinished project...


  • Please log in to reply
104 replies to this topic
Gerakon
  • Members
  • 11 posts
  • Last active: Aug 08 2013 04:15 PM
  • Joined: 14 Sep 2010
Here's what I've come up with so far, and honestly I'm probably in a similar situation - not having enough time to work on this. You can take a look and use whatever you like, though it's probably not functional enough to do much with.

The idea is to store information in an sqlite db so it should be fast. The search feature was going to be a search as you type regex/sqlite query though I hadn't gotten to the guts of that yet. Search results would show up in the column on the left, or all movies if there was nothing in the search field. The movie details in the code are hard coded, and just place holders to give an example of what I was attempting.

couldn't find a quick way to post an image. If it doesn't work for you, I'll see if I can find a way. I think I used AHKL.

#NoEnv
;#Warn All
;#Warn, LocalSameAsGlobal, Off

;Order of things - To do list
;Check images dir is available, else create dir
;Read Config (tmdb API Key, VLC Location, Movie Location
;Build options gui
;buld main gui
;Read DB and populate table
;Read Movie directories and add to DB - types to search vob, mkv, avi, mov,
;implement search
;
EnvGet, UserProfile, USERPROFILE
IfNotExist, %A_ScriptDir%\Images
	FileCreateDir %A_ScriptDir%\Images

;IfNotExist, %A_ScriptDir%\config.ini
;	gosub, LoadOptionsGui

IniRead, APIKey, %A_ScriptDir%\config.ini, Main, APIKey, 5DummyKey
IniRead, PlayerLoc, %A_ScriptDir%\config.ini, Main, PlayerLoc, %ProgramFiles%\VideoLAN\VLC\vlc.exe
IniRead, MovieLoc1, %A_ScriptDir%\config.ini, Main, MovieLoc1, %UserProfile%\Videos
IniRead, MovieLoc2, %A_ScriptDir%\config.ini, Main, MovieLoc2
;IniRead, MovieLoc3, %A_ScriptDir%\config.ini, Main, MovieLoc3, %UserProfile%\Videos


SetWorkingDir %A_ScriptDir% 
#Include <Database>


initialSQL := "SELECT * FROM tblVideo"
databaseType := "SQLite" ;MySQL | SQLite

if(databaseType = "SQLite"){
	
	connectionString := A_ScriptDir . "\video.db" ; SQLite Connectionstring
	; creates new DB when DB Path doesnt Exist
	if(FileExist(connectionString))
	   FileDelete, %connectionString%
	db := DataBaseFactory.OpenDataBase("SQLite", connectionString) ; SQLite
	CreateEmpty(db) ; SQLite
	
	
} else {
		MsgBox, 16, Error, Unkonwn Database type: '%databaseType%'!
}

Gui, Main:font, s16, Verdana
Gui, Main:Add, Text, X20 Y10, Search
Gui, Main:Add, Edit, X20 Y40 W320 H40
Gui, Main:Add, ListView, X20 Y90 W320 H700 vResultsLV,
Gui, Main:Add, Button, X360 Y40 W90 H40, Play
Gui, Main:Add, Button, X460 Y40 W90 H40, Trailer
Gui, Main:Add, Button, X560 Y40 W140 H40, HomePage
Gui, Main:Add, Button, X710 Y40 W140 H40 gLookup, Lookup
Gui, Main:Add, Button, X860 Y40 W140 H40 gLookupAll, Lookup All
Gui, Main:Add, GroupBox, X360 Y90 W800 H700, Total Recall
Gui, Main:Add, Picture, X380 Y120 W200 H300, dvd.jpg
Gui, Main:Add, Text, X590 Y120 W560 H200, Construction worker Douglas Quaid discovers a memory chip in his brain during a virtual-reality trip. He also finds that his past has been invented to conceal a plot of planetary domination. Soon, he's off to Mars to find out who he is and who planted the chip. 
;Gui, Main:Add, Text, X390 Y430, Total Recall
Gui, Main:Add, Text, X390 Y460, Original Name:
Gui, Main:Add, Text, X390 Y490, Alternative Name:
Gui, Main:Add, Text, X390 Y520, Released:
Gui, Main:Add, Text, X390 Y550, Run Time:
Gui, Main:Add, Text, X390 Y580, Budget:
Gui, Main:Add, Text, X390 Y610, Revenue:
Gui, Main:Add, Text, X390 Y640, Genre:
Gui, Main:Add, Text, X800 Y460, Cast:






Gui, Main:Add, StatusBar,, Loading

Gui, Main:Show
res := db.Query("Select * from tblVideo")
if(is(res,"Table")){
	SB_SetText("The Selection yielded " res.Count() " results.")
	ShowTable("ResultsLV", res)
}

Pause

return

Lookup:

return

LookupAll:
IfNotEqual, %MovieLoc1%, 
{
	Loop, %MovieLoc1%, 1, 1
		res := db.Query("Select * from tblVideo WHERE FileName=%A_LoopFileName%") 
		Pause



}
return
;Gui, +LastFound +OwnDialogs
;Gui, Margin, 10, 10
;Gui, Add, Text, w100 h20 0x200 vTX, SQL statement:
;Gui, Add, ComboBox, x+0 ym w590 vSQL Sort, %initialSQL%||
;GuiControlGet, P, Pos, SQL
;GuiControl, Move, TX, h%PH%
;Gui, Add, Button, ym w80 hp vRun gRunSQL Default, Run
;Gui, Add, Text, xm h20 w100 0x200, Table name:
;Gui, Add, GroupBox, xm w780 h330 , Results
;Gui, Add, ListView, xp+10 yp+18 w760 h300 vResultsLV,
;Gui, Add, Button, gTestRecordSetClick, [Test RecordSet]
;Gui, Add, StatusBar,
;Gui, Show, , sqlite test oop


;res := db.Query("Select * from VideoTbl")
;if(is(res,"Table")){
;	SB_SetText("The Selection yielded " res.Count() " results.")
;	ShowTable("ResultsLV", res)
;}

;TestInsert(db)

;return

;TestRecordSetClick:
;	TestRecordSet(db, initialSQL)
;return



;=======================================================================================================================
; Execute SQL-Statement
;=======================================================================================================================
RunSQL:
	GuiControlGet, SQL
	state := ""
	if(Trim(SQL) == "")
	{
	   SB_SetText("No text entered")
	   Return
	}
	res := db.Query(SQL)
	
	if(is(res, "Table")){
		SB_SetText("The Selection yielded " res.Count() " results.")
		ShowTable("ResultsLV", res)
	} else {
		state := "Non selection Query executed! Ret: " res
	}
	
	if(!IsObject(res) && !res){
			state := "!# " db.GetLastErrorMsg() " " res
	}
	if(state != "")
		SB_SetText(state)
return

TestInsert(db){
	;Table Layout: Name, Fname, Phone, Room
	record := {}
	record.Name := "Hans"
	record.Fname := "Meier"
	record.Phone := "93737337"
	record.Room := "wtf is room!? :D"
	db.Insert(record, "Test")
	
	res := db.Query("Select * from Test")
	if(is(res,"Table")){
		SB_SetText("The Selection yielded " res.Count() " results.")
		ShowTable("ResultsLV", res)
	}
}


TestRecordSet(db, sQry){
	rs := db.OpenRecordSet(sQry)
	while(!rs.EOF){	
		name := rs["Name"] 
		phone := rs["Phone"]

		MsgBox %name% %phone%
		rs.MoveNext()
	}
	rs.Close()
	MsgBox done :)
}

ShowTable(listView, table){
	
	GuiControl, -ReDraw, %listView%
	Gui, ListView, %listView%
	if(!is(table, "Table"))
		throw Exception("Table Object expected!",-1)
	
	LV_Delete()
	Loop, % LV_GetCount("Column")
	   LV_DeleteCol(1)
   
	for each, colName in table.Columns 
		LV_InsertCol(A_Index,"", colName)
	
	columnCount := table.Columns.Count()
	
	for each, row in table.Rows
	{
		rowNum := LV_Add("", "")
		Loop, % columnCount
			LV_Modify(rowNum, "Col" . A_index, row[A_index])
	}
	LV_ModifyCol()
	GuiControl, +ReDraw, %listView%
}

CreateEmpty(db){
	
	SB_SetText("Create Test Data")
	
	db.Query("CREATE TABLE tblVideo (CataclysmID INTEGER, FileName, FileLocation, MovieName, tmdbID, imdbID, Adult, OriginalName, AlternativeName, Rating, Released, Runtime, Budget, Revenue, Homepage, Genre, Studios, Country, Person, Version, LastModified, TrailerURL, ImageLoc PRIMARY KEY(CataclysmID ASC));")
	db.BeginTransaction()
	
	
}



GuiClose:
	db.Close()
Exitapp


Delusion
  • Members
  • 272 posts
  • Last active: Jul 13 2014 09:04 PM
  • Joined: 16 Jul 2008
*Update*

my laptop just died yesterday (i think something got fried inside because it was stinky) and wont even boot up anymore.i tried everything with no luck
im really pissed up on windows in gereral and pc's over the last few years so i will finally change over to mac.

i will try to save some data somehow and if im lucky i will get the latest version of popcorn
if not i have a little bit older backup from about 2 weeks ago

so i will be posting it here in the next few days but its incomplete and since i will switch over to mac i will not be doing anything anymore on windows
maybe someone will still find it usefull or someone wants to take over this project and continue it..if so pm me please
QuickSubs | Popcorn Movie Catalog
All my scripts are just in AutoHotkey v1.0.48.05

Morpheus
  • Members
  • 475 posts
  • Last active: Oct 21 2014 11:08 AM
  • Joined: 31 Jul 2008
If you take the hard drive out and connect it to a bootable computer you 'should' be able to use Recuva to recover your data.
Any code that I post will be for AHK Basic.
I'm not always right, but I still try to help.

Gerakon
  • Members
  • 11 posts
  • Last active: Aug 08 2013 04:15 PM
  • Joined: 14 Sep 2010
Sorry to hear about your laptop. As morpheus suggested, you should be able to remove the hard drive and plug it into another computer, or get a 2.5 in external enclosure from someplace like newegg and turn it into an External hard drive you could even use on the mac. Unless something went very wrong though, I would think you should be able to just plug it in and the hard drive should show up. I don't think recuva should necessary.

I would be interested to see the new version of popcorn. I'm not sure I would be able to be able to continue your project, as it seems difficult for me to pickup on other people's thought process in the scripts. I usually just rewrite them myself because then I know and understand exactly what each part of the script does.

Delusion
  • Members
  • 272 posts
  • Last active: Jul 13 2014 09:04 PM
  • Joined: 16 Jul 2008
i still didnt manage to find some time to recover my data but yeah i know how to do it.

i would be happy if someone would continue it or rewrite it...i know what you mean but when you will see the code its really organized.i think it wouldnt be so hard to figure out what everything does
i divided it to sections and i use pretty easy names for everything
QuickSubs | Popcorn Movie Catalog
All my scripts are just in AutoHotkey v1.0.48.05

Gerakon
  • Members
  • 11 posts
  • Last active: Aug 08 2013 04:15 PM
  • Joined: 14 Sep 2010
I'll take a look at it and give it a try, but like I said, time is at premium at the moment. I'm acquiring a partner in my current business, so things are a bit crazy at the moment, hopefully in a month or 2 things will settle down and I'll have a chance to dig into it a bit.
Thanks,
Gerakon

Morpheus
  • Members
  • 475 posts
  • Last active: Oct 21 2014 11:08 AM
  • Joined: 31 Jul 2008
As I said before, I am interested as well. I'm not fast, but eventually I get the job done. I would be willing to work with Gerakon if that is ok with him or her.
Any code that I post will be for AHK Basic.
I'm not always right, but I still try to help.

cezzadenz
  • Members
  • 1 posts
  • Last active: May 14 2012 03:37 AM
  • Joined: 14 May 2012
I am a beginner, if the code is hard to learn the code? because I've tried but still always fail ...
suggestion that I might have more updates for the latest developments , thanks

Delusion
  • Members
  • 272 posts
  • Last active: Jul 13 2014 09:04 PM
  • Joined: 16 Jul 2008
so i finally got my files saved! i posted the code on the first page
QuickSubs | Popcorn Movie Catalog
All my scripts are just in AutoHotkey v1.0.48.05

Morpheus
  • Members
  • 475 posts
  • Last active: Oct 21 2014 11:08 AM
  • Joined: 31 Jul 2008
Glad you were able to recover your work. Thanks for posting the source.
Any code that I post will be for AHK Basic.
I'm not always right, but I still try to help.

IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007
I've had a quick look over our script and made it runnable under AHK_L 32bit. Should still work under AHK Basic, though.
Special chars where removed from variable names, and I adjusted several other things.

Also, I've detected a couple of logic bugs, but they are not related to AHK_L in any way. I've fixed some of them to allow a clean start up.

As the script now runs under AHK_L, I hope you can find some new motivation to work on it.

<!-- m -->http://dl.securityvi... ... _AHK_L.zip<!-- m -->

Delusion
  • Members
  • 272 posts
  • Last active: Jul 13 2014 09:04 PM
  • Joined: 16 Jul 2008

I've had a quick look over our script and made it runnable under AHK_L 32bit. Should still work under AHK Basic, though.
Special chars where removed from variable names, and I adjusted several other things.

Also, I've detected a couple of logic bugs, but they are not related to AHK_L in any way. I've fixed some of them to allow a clean start up.

As the script now runs under AHK_L, I hope you can find some new motivation to work on it.

<!-- m -->http://dl.securityvi... ... _AHK_L.zip<!-- m -->


i had also made attemps to make it runnable under ahk_l 32bit
removed the special chars and did some other changes like you did but in the end i gave up
most of the guis still give me errors even in your version and i have no idea how to fix them.
also im not sure if some of the libraries and functions im using my script can work in ahk_l or what needs to be done to convert them

the main reason i am giving up on it is because im mostly using my new macbook now and my other windows laptop just when i need it
im not giving up on ahk entirely im still using it at my work alot..just this project needs too much time which i dont have

but like i said i would be very happy if someone took this project over and would continue developing it or even fully convert it to ahk_l
QuickSubs | Popcorn Movie Catalog
All my scripts are just in AutoHotkey v1.0.48.05

  • Guests
  • Last active:
  • Joined: --
nice script.the cover view is a bit slow but as i see its not finished so no worries
its a pity its not developed anymore

ditto87
  • Guests
  • Last active:
  • Joined: --
very nice script.i will be using this even if its unfinished
thanks alot :D

  • Guests
  • Last active:
  • Joined: --
theres no chance this will get updated huh? :(