Removing empty LPs from webapp

Also adding update.sh for easy server-side update
This commit is contained in:
Andreas Mieke 2015-09-26 13:45:14 +02:00
parent d473ba437c
commit 3d7b148679
14 changed files with 23 additions and 14 deletions

View file

@ -15,4 +15,3 @@
"TemplatesDirectory": "/home/andreas/Projekte/Go/src/git.1750studios.com/gronkhDE/gogronkh/gserver/templates/", "TemplatesDirectory": "/home/andreas/Projekte/Go/src/git.1750studios.com/gronkhDE/gogronkh/gserver/templates/",
"ImageDirectory": "/home/andreas/Gronkh/art/" "ImageDirectory": "/home/andreas/Gronkh/art/"
} }

View file

@ -269,4 +269,4 @@ func (e *Episode) BeforeSave() (err error) {
e.Duration.Valid = true e.Duration.Valid = true
} }
return return
} }

View file

@ -128,4 +128,4 @@ func UpdateAuthor(AT database.Author, bar *pb.ProgressBar) {
} else { } else {
log.Printf("SUC AT %s: Updated in database", AT.Slug.String) log.Printf("SUC AT %s: Updated in database", AT.Slug.String)
} }
} }

View file

@ -133,4 +133,4 @@ func UpdateLP(LP database.LetsPlay, bar *pb.ProgressBar) {
log.Printf("SUC LP %s: Updated in database", LP.Slug.String) log.Printf("SUC LP %s: Updated in database", LP.Slug.String)
} }
} }
} }

View file

@ -194,4 +194,4 @@ func UpdateLT(LT database.LetsTest, bar *pb.ProgressBar) {
database.Db.Delete(&LT) database.Db.Delete(&LT)
log.Printf("SUC LT %s: Removed from database", LT.Slug.String) log.Printf("SUC LT %s: Removed from database", LT.Slug.String)
} }
} }

View file

@ -50,4 +50,4 @@ func MainLoop() {
} }
wg.Wait() wg.Wait()
} }

View file

@ -208,4 +208,4 @@ func (ep *Episode) Votes(i sql.NullInt64) {
func (ep *Episode) Duration(i sql.NullInt64) { func (ep *Episode) Duration(i sql.NullInt64) {
ep.ADuration = i.Int64 ep.ADuration = i.Int64
} }

View file

@ -18,4 +18,4 @@
</ul> </ul>
</div> </div>
</div> </div>
{{ template "footer.html" . }} {{ template "footer.html" . }}

View file

@ -99,4 +99,4 @@
<noscript><p><img src="//piwik.1750studios.com/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript> <noscript><p><img src="//piwik.1750studios.com/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code --> <!-- End Piwik Code -->
</body> </body>
</html> </html>

View file

@ -43,4 +43,4 @@
</div> </div>
</div> </div>
</div> </div>
{{ end }} {{ end }}

View file

@ -19,4 +19,4 @@
</ul> </ul>
</div> </div>
</div> </div>
{{ template "footer.html" . }} {{ template "footer.html" . }}

View file

@ -15,4 +15,4 @@
</ul> </ul>
</div> </div>
</div> </div>
{{ template "footer.html" . }} {{ template "footer.html" . }}

View file

@ -30,7 +30,7 @@ func GetIndex(c *gin.Context) {
func GetLps(c *gin.Context) { func GetLps(c *gin.Context) {
var LPs []database.LetsPlay var LPs []database.LetsPlay
database.Db.Order("name asc").Find(&LPs) database.Db.Where("aired IS NOT NULL").Order("name asc").Find(&LPs)
var data []gin.H var data []gin.H
for _, LP := range LPs { for _, LP := range LPs {
var AT database.Author var AT database.Author
@ -87,7 +87,7 @@ func GetAt(c *gin.Context) {
var LTs []database.LetsTest var LTs []database.LetsTest
var EPs []database.Episode var EPs []database.Episode
var DEPs []gin.H var DEPs []gin.H
database.Db.Model(&AT).Limit(5).Order("aired desc").Related(&LPs).Related(&LTs).Related(&EPs) database.Db.Model(&AT).Where("aired IS NOT NULL").Limit(5).Order("aired desc").Related(&LPs).Related(&LTs).Related(&EPs)
for _, EP := range EPs { for _, EP := range EPs {
var ELP database.LetsPlay var ELP database.LetsPlay
database.Db.Model(&EP).Related(&ELP) database.Db.Model(&EP).Related(&ELP)

10
update.sh Normal file
View file

@ -0,0 +1,10 @@
cd $GOPATH/src/git.1750studios.com/gronkhDE/gogronkh
git pull origin master
go install ./config
go install ./database
go install ./image
go install ./youtube
go install ./gparser
go install ./gserver