prepare for release

This commit is contained in:
Ben Sarmiento
2023-10-20 18:40:13 +02:00
parent 9dcdb60ae7
commit cd6b94f868
4 changed files with 157 additions and 17 deletions

129
README.md
View File

@@ -1 +1,130 @@
# zurg # zurg
## Building
```bash
docker build -t debridmediamanager/zurg:latest .
```
This builds zurg
## config.yml
You need a `config.yml` created before you use zurg
```yaml
# Zurg configuration version
zurg: v1
token: YOUR_TOKEN_HERE
port: 9999
concurrent_workers: 10
check_for_changes_every_secs: 15
info_cache_time_hours: 12
# List of directory definitions and their filtering rules
directories:
# Configuration for TV shows
shows:
group: media # directories on different groups have duplicates of the same torrent
filters:
- regex: /season[\s\.]?\d/i # Capture torrent names with the term 'season' in any case
- regex: /Saison[\s\.]?\d/i # For non-English namings
- regex: /stage[\s\.]?\d/i
- regex: /s\d\d/i # Capture common season notations like S01, S02, etc.
- contains: complete
- contains: seasons
- id: ATUWVRF53X5DA
- contains_strict: PM19
- contains_strict: Detective Conan Remastered
- contains_strict: Goblin Slayer
# Configuration for movies
movies:
group: media # because movies and shows are in the same group, and shows come first before movies, all torrents that doesn't fall into shows will fall into movies
filters:
- regex: /.*/ # you cannot leave a directory without filters because it will not have any torrents in it
# Configuration for Dolby Vision content
"hd movies":
group: another
filters:
- regex: /\b2160|\b4k|\buhd|\bdovi|\bdolby.?vision|\bdv|\bremux/i # Matches abbreviations of 'dolby vision'
"low quality":
group: another
filters:
- regex: /.*/
# Configuration for children's content
kids:
group: kids
filters:
- contains: xxx # Ensures adult content is excluded
- id: XFPQ5UCMUVAEG # Specific inclusion by torrent ID
- id: VDRPYNRPQHEXC
- id: YELNX3XR5XJQM
```
## Running
### Standalone webdav server
```bash
docker run -v ./config.yml:/app/config.yml -v zurgdata:/app/data -p 9999:9999 debridmediamanager/zurg:latest
```
- Runs zurg on port 9999 on your localhost
- Make sure you have config.yml on the current directory
- It creates a `zurgdata` volume for the data files
### with rclone
```yaml
version: '3.8'
services:
zurg:
image: debridmediamanager/zurg:latest
restart: unless-stopped
ports:
- 9999:9999
volumes:
- ./config.yml:/app/config.yml
- zurgdata:/app/data
rclone:
image: rclone/rclone:latest
restart: unless-stopped
environment:
TZ: Europe/Berlin
PUID: 1000
PGID: 1000
volumes:
- ./media:/data
- ./rclone.conf:/config/rclone/rclone.conf
privileged: true
cap_add:
- SYS_ADMIN
devices:
- /dev/fuse
command: "mount zurg: /data --allow-other --allow-non-empty --uid 1000 --gid 1000 --dir-cache-time 1s --poll-interval 1s --read-only --log-level INFO"
volumes:
zurgdata:
```
You will need to create a `media` directory to make the rclone mount work.
Together with this `docker-compose.yml` you will need this `rclone.conf` as well on the same directory.
```
[zurg]
type = webdav
url = http://zurg:9999
vendor = other
```

View File

@@ -14,9 +14,16 @@ directories:
shows: shows:
group: media # directories on different groups have duplicates of the same torrent group: media # directories on different groups have duplicates of the same torrent
filters: filters:
- regex: /season/i # Capture torrent names with the term 'season' in any case - regex: /season[\s\.]?\d/i # Capture torrent names with the term 'season' in any case
- regex: /Saison/i # For non-English namings - regex: /Saison[\s\.]?\d/i # For non-English namings
- regex: /stage[\s\.]?\d/i
- regex: /s\d\d/i # Capture common season notations like S01, S02, etc. - regex: /s\d\d/i # Capture common season notations like S01, S02, etc.
- contains: complete
- contains: seasons
- id: ATUWVRF53X5DA
- contains_strict: PM19
- contains_strict: Detective Conan Remastered
- contains_strict: Goblin Slayer
# Configuration for movies # Configuration for movies
movies: movies:
@@ -24,27 +31,22 @@ directories:
filters: filters:
- regex: /.*/ # you cannot leave a directory without filters because it will not have any torrents in it - regex: /.*/ # you cannot leave a directory without filters because it will not have any torrents in it
# Configuration for remuxes
remuxes:
group: def
filters:
- contains: remux # Specifically target remuxed content
# Configuration for Dolby Vision content # Configuration for Dolby Vision content
"dolby vision": "hd movies":
group: random group: another
filters: filters:
- and: - regex: /\b2160|\b4k|\buhd|\bdovi|\bdolby.?vision|\bdv|\bremux/i # Matches abbreviations of 'dolby vision'
- regex: /\bdovi\b/i # Matches abbreviations of 'dolby vision'
- contains: 4k # you can be quite greedy here, dolby vision + 4k! "low quality":
group: another
filters:
- regex: /.*/
# Configuration for children's content # Configuration for children's content
kids: kids:
group: kids group: kids
filters: filters:
- or: # you can also group conditions with 'or' which is useful especially inside 'and' conditions - contains: xxx # Ensures adult content is excluded
- not_contains: xxx # Ensures adult content is excluded
- not_contains_strict: trailer # strict vs non-strict is just about case sensitivity; this ensures trailers aren't added
- id: XFPQ5UCMUVAEG # Specific inclusion by torrent ID - id: XFPQ5UCMUVAEG # Specific inclusion by torrent ID
- id: VDRPYNRPQHEXC - id: VDRPYNRPQHEXC
- id: YELNX3XR5XJQM - id: YELNX3XR5XJQM

View File

@@ -53,7 +53,7 @@ func createSingleTorrentResponse(basePath string, torrents []torrent.Torrent, t
// TODO: trigger a re-add for the file // TODO: trigger a re-add for the file
// It is selected but no link is available // It is selected but no link is available
// I think this is handled on the manager side so we just need to refresh // I think this is handled on the manager side so we just need to refresh
t.RefreshInfo(torrent.ID) // t.RefreshInfo(torrent.ID)
continue continue
} }
filename := filepath.Base(file.Path) filename := filepath.Base(file.Path)

View File

@@ -297,6 +297,15 @@ func (t *TorrentManager) writeToFile(torrentID string, torrent *Torrent) {
func (t *TorrentManager) readFromFile(torrentID string) *Torrent { func (t *TorrentManager) readFromFile(torrentID string) *Torrent {
filePath := fmt.Sprintf("data/%s.bin", torrentID) filePath := fmt.Sprintf("data/%s.bin", torrentID)
fileInfo, err := os.Stat(filePath)
if err != nil {
return nil
}
if time.Since(fileInfo.ModTime()) > time.Duration(t.config.GetCacheTimeHours())*time.Hour {
return nil
}
file, err := os.Open(filePath) file, err := os.Open(filePath)
if err != nil { if err != nil {
return nil return nil