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,10 +1,10 @@
1 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 3
 	<!-- Generated by coverage.py: https://coverage.readthedocs.io -->
4 4
 	<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
5 5
 	<sources/>
6 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 8
 			<classes>
9 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 10
 					<methods/>
@@ -28,7 +28,7 @@
28 28
 						<line hits="1" number="50"/>
29 29
 					</lines>
30 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 32
 					<methods/>
33 33
 					<lines>
34 34
 						<line hits="1" number="1"/>
@@ -114,48 +114,48 @@
114 114
 						<line hits="1" number="98"/>
115 115
 						<line branch="true" condition-coverage="100% (2/2)" hits="1" number="100"/>
116 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 118
 						<line hits="1" number="104"/>
119
-						<line hits="1" number="106"/>
119
+						<line hits="1" number="105"/>
120 120
 						<line hits="1" number="107"/>
121
-						<line hits="1" number="109"/>
121
+						<line hits="1" number="108"/>
122 122
 						<line hits="1" number="110"/>
123 123
 						<line hits="1" number="111"/>
124
-						<line hits="1" number="114"/>
124
+						<line hits="1" number="112"/>
125 125
 						<line hits="1" number="115"/>
126 126
 						<line hits="1" number="116"/>
127
-						<line hits="1" number="118"/>
127
+						<line hits="1" number="117"/>
128 128
 						<line hits="1" number="119"/>
129
-						<line hits="1" number="121"/>
129
+						<line hits="1" number="120"/>
130 130
 						<line hits="1" number="122"/>
131 131
 						<line hits="1" number="123"/>
132 132
 						<line hits="1" number="124"/>
133 133
 						<line hits="1" number="125"/>
134
-						<line hits="0" number="126"/>
134
+						<line hits="1" number="126"/>
135 135
 						<line hits="0" number="127"/>
136 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 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 145
 						<line hits="1" number="139"/>
146 146
 						<line hits="1" number="140"/>
147 147
 						<line hits="1" number="141"/>
148 148
 						<line hits="1" number="142"/>
149 149
 						<line hits="1" number="143"/>
150
-						<line hits="1" number="146"/>
150
+						<line hits="1" number="144"/>
151 151
 						<line hits="1" number="147"/>
152 152
 						<line hits="1" number="148"/>
153 153
 						<line hits="1" number="149"/>
154 154
 						<line hits="1" number="150"/>
155 155
 						<line hits="1" number="151"/>
156 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 159
 						<line hits="1" number="157"/>
160 160
 						<line hits="1" number="158"/>
161 161
 						<line hits="1" number="159"/>
@@ -168,61 +168,62 @@
168 168
 						<line hits="1" number="166"/>
169 169
 						<line hits="1" number="167"/>
170 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 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 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 177
 						<line hits="1" number="175"/>
178
-						<line hits="1" number="179"/>
178
+						<line hits="1" number="176"/>
179 179
 						<line hits="1" number="180"/>
180 180
 						<line hits="1" number="181"/>
181
-						<line hits="1" number="184"/>
181
+						<line hits="1" number="182"/>
182 182
 						<line hits="1" number="185"/>
183 183
 						<line hits="1" number="186"/>
184 184
 						<line hits="1" number="187"/>
185 185
 						<line hits="1" number="188"/>
186 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 189
 						<line hits="1" number="192"/>
190 190
 						<line hits="1" number="193"/>
191
-						<line hits="1" number="196"/>
191
+						<line hits="1" number="194"/>
192 192
 						<line hits="1" number="197"/>
193
-						<line hits="1" number="210"/>
193
+						<line hits="1" number="198"/>
194 194
 						<line hits="1" number="211"/>
195
-						<line hits="1" number="228"/>
195
+						<line hits="1" number="212"/>
196 196
 						<line hits="1" number="229"/>
197 197
 						<line hits="1" number="230"/>
198 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 203
 						<line hits="1" number="236"/>
204
-						<line hits="1" number="239"/>
204
+						<line hits="1" number="237"/>
205 205
 						<line hits="1" number="240"/>
206 206
 						<line hits="1" number="241"/>
207
-						<line hits="1" number="244"/>
207
+						<line hits="1" number="242"/>
208 208
 						<line hits="1" number="245"/>
209 209
 						<line hits="1" number="246"/>
210 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 213
 						<line hits="1" number="250"/>
214 214
 						<line hits="1" number="251"/>
215 215
 						<line hits="1" number="252"/>
216 216
 						<line hits="1" number="253"/>
217 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 220
 						<line hits="1" number="257"/>
221 221
 						<line hits="1" number="258"/>
222
-						<line hits="1" number="261"/>
222
+						<line hits="1" number="259"/>
223 223
 						<line hits="1" number="262"/>
224 224
 						<line hits="1" number="263"/>
225 225
 						<line hits="1" number="264"/>
226
+						<line hits="1" number="265"/>
226 227
 					</lines>
227 228
 				</class>
228 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,12 +99,13 @@ def __adapt__data__(data, full_path):
99 99
     # Add time if not exists
100 100
     if KEY_TIME not in data:
101 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 109
         else:
109 110
             data[KEY_TIME] = int(os.path.getmtime(full_path))
110 111
             data[KEY_TIME_IS_SUBSTITUTION] = True

Loading…
Cancel
Save