-
Notifications
You must be signed in to change notification settings - Fork 0
/
load.cl
80 lines (70 loc) · 2.34 KB
/
load.cl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
(in-package :user)
(load "sys.cl")
(setq *tget-data-directory* *default-pathname-defaults*)
(setq *database-main-name* (merge-pathnames "main.db" *load-pathname*))
(setq *database-temp-name* (merge-pathnames "temp.db" *load-pathname*))
(setq *version-file* (pathname (format nil "~a/version.cl"
*database-main-name*)))
(setq *log-file* (merge-pathnames "ep.log" *load-pathname*))
(setq *config-file* (merge-pathnames "tget-config/config.cl" *load-pathname*))
(setq *debug* nil) ;; too verbose
(setq *feed-interval* 180)
(setq *learn* t)
(setq *verbose* 1)
(setq *auto-backup* nil)
(defun opendb (&key reset copy-db compact)
(setq *transmission-remote* nil)
(when *main*
(close-tget-database)
(setq *torrent-handler* nil))
(when copy-db
(when (string= (namestring copy-db) (namestring *database-main-name*))
(error "They're the same database!"))
(when (probe-file *database-main-name*)
(delete-directory-and-files *database-main-name*))
(copy-directory (pathname-as-directory copy-db)
(pathname-as-directory *database-main-name*)
:quiet nil))
(open-tget-database :compact compact
:if-exists (if* reset
then :supersede
else :open))
(load *config-file* :verbose t))
(dolist (v '(*tget-version*
*schema-version*
*tget-data-directory*
*auto-backup*
*database-main-name*
*database-temp-name*
*version-file*
*config-file*
*debug*
*feed-interval*
*log-rss*
*log-xml*
*log-file*))
(format t ";; ~a => ~s~%"
v (symbol-value v)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; debugging
(open-log-files :truncate t)
(pprint
`(progn
(opendb :reset t)
(setq rss-objects (feed-to-rss-objects :file "tget-test-data/btn.xml"))
;;(setq rss-objects (feed-to-rss-objects :file "tget-test-data/eztv.xml"))
;;(setq rss-objects (feed-to-rss-objects :file "tget-test-data/dtt.xml"))
;;(setq rss-objects (feed-to-rss-objects :file "tget-test-data/tvt.xml"))
(setq show-objects (mapcar #'rss-to-episode rss-objects))
(commit)))
(pprint
`(progn
(opendb :reset t)
(process-groups)))
;; test speed of processing episodes:
(pprint
`(progn
(opendb :copy-db "~/.tget.d/db")
(prof:with-profiling () (process-groups))))
(pprint `(test-tget))
(pprint `(test-tget-processing))