sindex 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,23 +1,20 @@
1
1
  # Sindex [![Build Status](https://secure.travis-ci.org/pboehm/sindex.png)](http://travis-ci.org/pboehm/sindex)
2
2
 
3
-
4
3
  Sindex is a tool and library that manages an index file, which contains the tv
5
4
  series and episodes you have been watched. This index can be used by other
6
5
  tools like `sjunkieex` to determine new episodes that you are interested in.
6
+ [Here](https://github.com/pboehm/sindex/blob/master/test/seriesindex_example.xml)
7
+ is an example, how an index looks like and what features are supported.
7
8
 
8
9
  ## Installation
9
10
 
10
- Add this line to your application's Gemfile:
11
-
12
- gem 'sindex'
13
-
14
- And then execute:
11
+ `sindex` requires Ruby 1.9 to work, then you can install it through:
15
12
 
16
- $ bundle
13
+ $ [sudo] gem install sindex
17
14
 
18
- Or install it yourself as:
19
-
20
- $ gem install sindex
15
+ You can configure `sindex` in `~/.sindex/config.yml` after initial
16
+ execution. The standard path for the episode index is
17
+ `~/.sindex/seriesindex.xml`.
21
18
 
22
19
  ## Dependencies
23
20
 
@@ -27,7 +24,71 @@ Or install it yourself as:
27
24
 
28
25
  ## Usage
29
26
 
30
- TODO: Write usage instructions here
27
+ ### Initial creation of an index
28
+
29
+ `sindex` allows you to build an index from a directory, that contains your
30
+ watched series and episodes. The directory from which the index is built,
31
+ should have the following structure:
32
+
33
+ /path/to/your/series_directory/
34
+ ├── Chuck
35
+ │   └── .......
36
+ ├── Community
37
+ │   └── .......
38
+ └── The Big Bang Theory
39
+ └── .......
40
+
41
+ `sindex` treats all directories in your supplied directory as series, so you
42
+ should name they correct. In these directories, all Video-files (recursively)
43
+ containing `S0xE0x` are added for the series to the index. It is recommended to
44
+ rename your episode with a tool like
45
+ [serienrenamer](https://github.com/pboehm/serienrenamer), which renames your
46
+ episodes into this format.
47
+
48
+ The following command creates an index from the directory `/home/user/Serien`
49
+ and writes it to `/home/user/Desktop/index.xml`:
50
+
51
+ $ sindex --buildindex ~/Serien --indexfile ~/Desktop/index.xml
52
+
53
+ If your episodes are not in German, you have to add `--language [en|fr]`. Now
54
+ you should make changes to the index if required and move this to the path
55
+ specified by `index_file`.
56
+
57
+ ### Adding new episodes to the index
58
+
59
+ `sindex` wouldn't be useful without the option to add new episodes to the
60
+ index. If you have downloaded and renamed your new episodes, you can type only
61
+ `sindex` and a similar output can be viewed.
62
+
63
+ [user@host ~]% ls ~/Downloads
64
+ S04E21 - Kopfjäger.mkv
65
+ [user@host ~]% sindex
66
+
67
+ >>> S04E21 - Kopfjäger.mkv
68
+ << from infostore: Castle
69
+ << selected series name: Castle
70
+ << language: de
71
+ Added 'S04E21 - Kopfjäger.mkv' to index
72
+
73
+ Should I write the new index? y
74
+ New Index version has been written
75
+
76
+ After that, an updated version of the index is written to disk, which contains
77
+ the new episode.
78
+
79
+ ## Hooks
80
+
81
+ `sindex` allows you to define three kinds of Hooks, that are executed at special places. You can supply Scripts or command lines to be executed as Hooks.
82
+
83
+ * `pre_processing_hook` is called before the index is parsed on adding new
84
+ episodes. This allows you to do a `git pull` on your version controlled
85
+ series index or something else.
86
+ * `post_processing_hook` is called when a new index is written. I use this
87
+ to do a `git commit` and `git push` to save the index on Github.
88
+ * `episode_hook` is called for every episode after a new index is written.
89
+ The parameters are the filename (relative to `episode_directory`) and second
90
+ the series name. I use this to move the episodes out of my Download folder
91
+ into a special directory structure.
31
92
 
32
93
  ## Contributing
33
94
 
@@ -231,11 +231,8 @@ module Sindex
231
231
  # Returns the seriesname in index or nil if it does not exist
232
232
  def series_name_in_index(name)
233
233
 
234
- @series_data.each do |key, val|
235
- if key.match(/#{name}/i)
236
- return key
237
- end
238
- end
234
+ matching_series = @series_data.keys.grep(/#{name}/i).first
235
+ return matching_series if matching_series
239
236
 
240
237
  @series_aliases.each do |key, val|
241
238
  if key.match(/#{name}/i)
@@ -1,3 +1,3 @@
1
1
  module Sindex
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sindex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-16 00:00:00.000000000 Z
12
+ date: 2012-11-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -133,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  segments:
135
135
  - 0
136
- hash: -4573183238350985480
136
+ hash: -1112075699874427594
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  segments:
144
144
  - 0
145
- hash: -4573183238350985480
145
+ hash: -1112075699874427594
146
146
  requirements: []
147
147
  rubyforge_project:
148
148
  rubygems_version: 1.8.24