Browse Source

Release: 4111f28402

master
Dirk Alders 4 years ago
parent
commit
488c70884b
4 changed files with 480 additions and 392 deletions
  1. 43
    42
      _testresults_/coverage.xml
  2. 430
    344
      _testresults_/unittest.json
  3. BIN
      _testresults_/unittest.pdf
  4. 7
    6
      metadata.py

+ 43
- 42
_testresults_/coverage.xml View File

1
 <?xml version="1.0" ?>
1
 <?xml version="1.0" ?>
2
-<coverage branch-rate="0.975" branches-covered="39" branches-valid="40" complexity="0" line-rate="0.9856" lines-covered="206" lines-valid="209" timestamp="1580423734911" version="4.5">
2
+<coverage branch-rate="0.9762" branches-covered="41" branches-valid="42" complexity="0" line-rate="0.9857" lines-covered="207" lines-valid="210" timestamp="1580454618005" version="4.5">
3
 	<!-- Generated by coverage.py: https://coverage.readthedocs.io -->
3
 	<!-- Generated by coverage.py: https://coverage.readthedocs.io -->
4
 	<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
4
 	<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
5
 	<sources/>
5
 	<sources/>
6
 	<packages>
6
 	<packages>
7
-		<package branch-rate="0.975" complexity="0" line-rate="0.9856" name=".user_data.data.dirk.prj.unittest.media.pylibs.media">
7
+		<package branch-rate="0.9762" complexity="0" line-rate="0.9857" name=".user_data.data.dirk.prj.unittest.media.pylibs.media">
8
 			<classes>
8
 			<classes>
9
 				<class branch-rate="1" complexity="0" filename="/user_data/data/dirk/prj/unittest/media/pylibs/media/__init__.py" line-rate="1" name="__init__.py">
9
 				<class branch-rate="1" complexity="0" filename="/user_data/data/dirk/prj/unittest/media/pylibs/media/__init__.py" line-rate="1" name="__init__.py">
10
 					<methods/>
10
 					<methods/>
28
 						<line hits="1" number="50"/>
28
 						<line hits="1" number="50"/>
29
 					</lines>
29
 					</lines>
30
 				</class>
30
 				</class>
31
-				<class branch-rate="0.9706" complexity="0" filename="/user_data/data/dirk/prj/unittest/media/pylibs/media/metadata.py" line-rate="0.9844" name="metadata.py">
31
+				<class branch-rate="0.9722" complexity="0" filename="/user_data/data/dirk/prj/unittest/media/pylibs/media/metadata.py" line-rate="0.9845" name="metadata.py">
32
 					<methods/>
32
 					<methods/>
33
 					<lines>
33
 					<lines>
34
 						<line hits="1" number="1"/>
34
 						<line hits="1" number="1"/>
114
 						<line hits="1" number="98"/>
114
 						<line hits="1" number="98"/>
115
 						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="100"/>
115
 						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="100"/>
116
 						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="101"/>
116
 						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="101"/>
117
-						<line hits="1" number="103"/>
117
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="102"/>
118
 						<line hits="1" number="104"/>
118
 						<line hits="1" number="104"/>
119
-						<line hits="1" number="106"/>
119
+						<line hits="1" number="105"/>
120
 						<line hits="1" number="107"/>
120
 						<line hits="1" number="107"/>
121
-						<line hits="1" number="109"/>
121
+						<line hits="1" number="108"/>
122
 						<line hits="1" number="110"/>
122
 						<line hits="1" number="110"/>
123
 						<line hits="1" number="111"/>
123
 						<line hits="1" number="111"/>
124
-						<line hits="1" number="114"/>
124
+						<line hits="1" number="112"/>
125
 						<line hits="1" number="115"/>
125
 						<line hits="1" number="115"/>
126
 						<line hits="1" number="116"/>
126
 						<line hits="1" number="116"/>
127
-						<line hits="1" number="118"/>
127
+						<line hits="1" number="117"/>
128
 						<line hits="1" number="119"/>
128
 						<line hits="1" number="119"/>
129
-						<line hits="1" number="121"/>
129
+						<line hits="1" number="120"/>
130
 						<line hits="1" number="122"/>
130
 						<line hits="1" number="122"/>
131
 						<line hits="1" number="123"/>
131
 						<line hits="1" number="123"/>
132
 						<line hits="1" number="124"/>
132
 						<line hits="1" number="124"/>
133
 						<line hits="1" number="125"/>
133
 						<line hits="1" number="125"/>
134
-						<line hits="0" number="126"/>
134
+						<line hits="1" number="126"/>
135
 						<line hits="0" number="127"/>
135
 						<line hits="0" number="127"/>
136
 						<line hits="0" number="128"/>
136
 						<line hits="0" number="128"/>
137
-						<line hits="1" number="130"/>
138
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="131"/>
139
-						<line hits="1" number="132"/>
140
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="133"/>
141
-						<line hits="1" number="134"/>
137
+						<line hits="0" number="129"/>
138
+						<line hits="1" number="131"/>
139
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="132"/>
140
+						<line hits="1" number="133"/>
141
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="134"/>
142
 						<line hits="1" number="135"/>
142
 						<line hits="1" number="135"/>
143
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="137"/>
144
-						<line hits="1" number="138"/>
143
+						<line hits="1" number="136"/>
144
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="138"/>
145
 						<line hits="1" number="139"/>
145
 						<line hits="1" number="139"/>
146
 						<line hits="1" number="140"/>
146
 						<line hits="1" number="140"/>
147
 						<line hits="1" number="141"/>
147
 						<line hits="1" number="141"/>
148
 						<line hits="1" number="142"/>
148
 						<line hits="1" number="142"/>
149
 						<line hits="1" number="143"/>
149
 						<line hits="1" number="143"/>
150
-						<line hits="1" number="146"/>
150
+						<line hits="1" number="144"/>
151
 						<line hits="1" number="147"/>
151
 						<line hits="1" number="147"/>
152
 						<line hits="1" number="148"/>
152
 						<line hits="1" number="148"/>
153
 						<line hits="1" number="149"/>
153
 						<line hits="1" number="149"/>
154
 						<line hits="1" number="150"/>
154
 						<line hits="1" number="150"/>
155
 						<line hits="1" number="151"/>
155
 						<line hits="1" number="151"/>
156
 						<line hits="1" number="152"/>
156
 						<line hits="1" number="152"/>
157
-						<line hits="1" number="154"/>
158
-						<line hits="1" number="156"/>
157
+						<line hits="1" number="153"/>
158
+						<line hits="1" number="155"/>
159
 						<line hits="1" number="157"/>
159
 						<line hits="1" number="157"/>
160
 						<line hits="1" number="158"/>
160
 						<line hits="1" number="158"/>
161
 						<line hits="1" number="159"/>
161
 						<line hits="1" number="159"/>
168
 						<line hits="1" number="166"/>
168
 						<line hits="1" number="166"/>
169
 						<line hits="1" number="167"/>
169
 						<line hits="1" number="167"/>
170
 						<line hits="1" number="168"/>
170
 						<line hits="1" number="168"/>
171
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="169"/>
171
+						<line hits="1" number="169"/>
172
 						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="170"/>
172
 						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="170"/>
173
-						<line hits="1" number="171"/>
173
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="171"/>
174
 						<line hits="1" number="172"/>
174
 						<line hits="1" number="172"/>
175
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="173"/>
176
-						<line hits="1" number="174"/>
175
+						<line hits="1" number="173"/>
176
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="174"/>
177
 						<line hits="1" number="175"/>
177
 						<line hits="1" number="175"/>
178
-						<line hits="1" number="179"/>
178
+						<line hits="1" number="176"/>
179
 						<line hits="1" number="180"/>
179
 						<line hits="1" number="180"/>
180
 						<line hits="1" number="181"/>
180
 						<line hits="1" number="181"/>
181
-						<line hits="1" number="184"/>
181
+						<line hits="1" number="182"/>
182
 						<line hits="1" number="185"/>
182
 						<line hits="1" number="185"/>
183
 						<line hits="1" number="186"/>
183
 						<line hits="1" number="186"/>
184
 						<line hits="1" number="187"/>
184
 						<line hits="1" number="187"/>
185
 						<line hits="1" number="188"/>
185
 						<line hits="1" number="188"/>
186
 						<line hits="1" number="189"/>
186
 						<line hits="1" number="189"/>
187
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="190"/>
188
-						<line hits="1" number="191"/>
187
+						<line hits="1" number="190"/>
188
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="191"/>
189
 						<line hits="1" number="192"/>
189
 						<line hits="1" number="192"/>
190
 						<line hits="1" number="193"/>
190
 						<line hits="1" number="193"/>
191
-						<line hits="1" number="196"/>
191
+						<line hits="1" number="194"/>
192
 						<line hits="1" number="197"/>
192
 						<line hits="1" number="197"/>
193
-						<line hits="1" number="210"/>
193
+						<line hits="1" number="198"/>
194
 						<line hits="1" number="211"/>
194
 						<line hits="1" number="211"/>
195
-						<line hits="1" number="228"/>
195
+						<line hits="1" number="212"/>
196
 						<line hits="1" number="229"/>
196
 						<line hits="1" number="229"/>
197
 						<line hits="1" number="230"/>
197
 						<line hits="1" number="230"/>
198
 						<line hits="1" number="231"/>
198
 						<line hits="1" number="231"/>
199
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="232"/>
200
-						<line hits="1" number="233"/>
201
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="234"/>
202
-						<line hits="1" number="235"/>
199
+						<line hits="1" number="232"/>
200
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="233"/>
201
+						<line hits="1" number="234"/>
202
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="235"/>
203
 						<line hits="1" number="236"/>
203
 						<line hits="1" number="236"/>
204
-						<line hits="1" number="239"/>
204
+						<line hits="1" number="237"/>
205
 						<line hits="1" number="240"/>
205
 						<line hits="1" number="240"/>
206
 						<line hits="1" number="241"/>
206
 						<line hits="1" number="241"/>
207
-						<line hits="1" number="244"/>
207
+						<line hits="1" number="242"/>
208
 						<line hits="1" number="245"/>
208
 						<line hits="1" number="245"/>
209
 						<line hits="1" number="246"/>
209
 						<line hits="1" number="246"/>
210
 						<line hits="1" number="247"/>
210
 						<line hits="1" number="247"/>
211
-						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="248"/>
212
-						<line hits="1" number="249"/>
211
+						<line hits="1" number="248"/>
212
+						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="249"/>
213
 						<line hits="1" number="250"/>
213
 						<line hits="1" number="250"/>
214
 						<line hits="1" number="251"/>
214
 						<line hits="1" number="251"/>
215
 						<line hits="1" number="252"/>
215
 						<line hits="1" number="252"/>
216
 						<line hits="1" number="253"/>
216
 						<line hits="1" number="253"/>
217
 						<line hits="1" number="254"/>
217
 						<line hits="1" number="254"/>
218
-						<line branch="true" condition-coverage="50% (1/2)" hits="1" missing-branches="exit" number="255"/>
219
-						<line hits="1" number="256"/>
218
+						<line hits="1" number="255"/>
219
+						<line branch="true" condition-coverage="50% (1/2)" hits="1" missing-branches="exit" number="256"/>
220
 						<line hits="1" number="257"/>
220
 						<line hits="1" number="257"/>
221
 						<line hits="1" number="258"/>
221
 						<line hits="1" number="258"/>
222
-						<line hits="1" number="261"/>
222
+						<line hits="1" number="259"/>
223
 						<line hits="1" number="262"/>
223
 						<line hits="1" number="262"/>
224
 						<line hits="1" number="263"/>
224
 						<line hits="1" number="263"/>
225
 						<line hits="1" number="264"/>
225
 						<line hits="1" number="264"/>
226
+						<line hits="1" number="265"/>
226
 					</lines>
227
 					</lines>
227
 				</class>
228
 				</class>
228
 			</classes>
229
 			</classes>

+ 430
- 344
_testresults_/unittest.json
File diff suppressed because it is too large
View File


BIN
_testresults_/unittest.pdf View File


+ 7
- 6
metadata.py View File

99
     # Add time if not exists
99
     # Add time if not exists
100
     if KEY_TIME not in data:
100
     if KEY_TIME not in data:
101
         if KEY_YEAR in data and KEY_TRACK in data:
101
         if KEY_YEAR in data and KEY_TRACK in data:
102
-            # Use a date where track 1 is the newest in the given year
103
-            minute = int(data[KEY_TRACK] / 60)
104
-            second = (data[KEY_TRACK] - 60 * minute) % 60
105
-            #
106
-            data[KEY_TIME] = int(time.mktime((data[KEY_YEAR], 1, 1, 0, 59 - minute, 59 - second, 0, 0, 0)))
107
-            data[KEY_TIME_IS_SUBSTITUTION] = True
102
+            if data[KEY_YEAR] != 0:  # ignore year 0 - must be wrong
103
+                # Use a date where track 1 is the newest in the given year
104
+                minute = int(data[KEY_TRACK] / 60)
105
+                second = (data[KEY_TRACK] - 60 * minute) % 60
106
+                #
107
+                data[KEY_TIME] = int(time.mktime((data[KEY_YEAR], 1, 1, 0, 59 - minute, 59 - second, 0, 0, 0)))
108
+                data[KEY_TIME_IS_SUBSTITUTION] = True
108
         else:
109
         else:
109
             data[KEY_TIME] = int(os.path.getmtime(full_path))
110
             data[KEY_TIME] = int(os.path.getmtime(full_path))
110
             data[KEY_TIME_IS_SUBSTITUTION] = True
111
             data[KEY_TIME_IS_SUBSTITUTION] = True

Loading…
Cancel
Save