Skip to content

Commit

Permalink
Merge branch 'release/v1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
slaveofcode committed May 7, 2020
2 parents 75ca026 + e2908f9 commit f822d6e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Voodio Change Log
All notable changes to this project will be documented in this file.

## [1.3.1]
- 26d7df7 Added IP server information
- 6b82771 Merge tag 'v1.3.0' into develop

## [1.3.0]
- ee2927b Update readme
- ca46c1f Merge branch 'master' of github.com:slaveofcode/voodio into develop
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@ Go to the prebuilt binary on the [release section here](https://github.com/slave

// run the binary with path to the parent of video directories from your module binary path
// options for port and ffmpeg-bin are optional
~/go/bin/voodio -port 8080 -tmdb-key <your-tmdb-key> -ffmpeg-bin /usr/bin/ffmpeg -path /path/to/videos/dir -resolution 720p -resolution 480p
GOPATH/bin/voodio -port 8080 -tmdb-key <your-tmdb-key> -ffmpeg-bin /path/to/ffmpeg -path /path/to/videos -resolution 720p -resolution 480p

If the configuration and steps above is complete, you can heads up to http://[your-ip-host-or-localhost]:8080 on your browser to start watching.
If the configuration and steps above is complete, you can heads up to http://[your-ip-host-or-localhost]:8080 on your browser to start select the movie and generate HLS first before starting to watch.

### Running Options
### Options

- `-path` The full path of the video directory
- `-tmdb-key` API key of TMDB, you can grab one at [Official TMDB API](https://www.themoviedb.org/documentation/api)
- `-port` (optional) The port number for the server to run, default to 1818
- `-ffmpeg-bin` (optional) The path of FFmpeg binary, if you have a different path of FFmpeg
- `-resolution` (optional) By default the program will produce 4 resolution (360p, 480p, 720p and 1080p), this option can be supplied multiple times


### Screenshot
<img src="https://raw.github.com/slaveofcode/voodio/master/assets/home.png" align="center" />
<img src="https://raw.github.com/slaveofcode/voodio/master/assets/detail.png" align="center" />
Expand Down
17 changes: 16 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package main
import (
"context"
"flag"
"net"
"net/http"
"os"
"os/signal"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -187,7 +189,8 @@ func main() {
}()

log.Infoln("Activate API Server")
log.Infoln("Server is alive on port", *serverPort)
log.Infoln("Server is alive")
showIPServer(*serverPort)
if err = webServer.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Errorln("Unable to start server on port", *serverPort)
}
Expand All @@ -199,6 +202,18 @@ func main() {
log.Infoln("Server closed")
}

func showIPServer(port int) {
addrs, _ := net.InterfaceAddrs()

for _, a := range addrs {
if ipnet, ok := a.(*net.IPNet); ok {
if ipnet.IP.To4() != nil {
log.Infoln("http://" + ipnet.IP.String() + ":" + strconv.Itoa(port))
}
}
}
}

func saveMovies(dbConn *gorm.DB, movies []collections.MovieDirInfo) {
for _, movie := range movies {
dirName := filepath.Base(movie.Dir)
Expand Down

0 comments on commit f822d6e

Please sign in to comment.