Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit a6739c7

Browse files
committed
syntax corrections
Changed syntax errors in vsMetaInfo, allowing to shorten the tests.
1 parent a134517 commit a6739c7

File tree

5 files changed

+43
-12
lines changed

5 files changed

+43
-12
lines changed

src/setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from setuptools import setup
2+
3+
setup(name='vsmetaEncoder',
4+
version='0.1',
5+
description='A module to encode media information with Synology\'s vsmeta file format.',
6+
url='https://github.com/TomMeHo/vsMetaFileEncoder',
7+
author='Thomas Meder',
8+
author_email='[email protected]',
9+
license='GPL-3.0',
10+
packages=['vsmetaEncoder'],
11+
zip_safe=False)
97 Bytes
Binary file not shown.

src/tests/template3.vsmeta

97 Bytes
Binary file not shown.

src/tests/testvsmetaEncoder.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ def test_encodeTemplate2(self):
2424

2525
info.chapterSummary = "Zusammenfassung"
2626

27-
info.episode = 0 # TODO delete
28-
info.season = 0 # TODO delete
29-
3027
# execute, prepare result
3128
writer = VsMetaEncoder()
3229
testData = writer.encode(info)
@@ -38,7 +35,30 @@ def test_encodeTemplate2(self):
3835
compareBytesBitByBit(self, template, testData)
3936
compareBytesLength(self, template, testData)
4037

38+
def test_encodeTemplate3(self):
39+
40+
# setup class under test
41+
info = VsMetaInfo()
42+
info.showTitle = 'aaa20210122'
43+
info.tvshowReleaseDate = date(2021, 1, 22)
44+
info.tvshowLocked = True
45+
46+
info.episodeTitle = 'Episode'
47+
info.episodeReleaseDate = date(2021, 1, 21)
48+
info.episodeLocked = True
49+
50+
info.chapterSummary = "Text"
4151

52+
# execute, prepare result
53+
writer = VsMetaEncoder()
54+
testData = writer.encode(info)
55+
56+
writeVsMetaFile(os.path.join(os.path.dirname(os.path.realpath(__file__)),'template3-reconstructed.vsmeta'), testData)
57+
58+
# compare
59+
template = readTemplateFile(os.path.join(os.path.dirname(os.path.realpath(__file__)),"template3.vsmeta"))
60+
compareBytesBitByBit(self, template, testData)
61+
compareBytesLength(self, template, testData)
4262

4363
if __name__ == "__main__":
4464
unittest.main()

src/vsmetaEncoder/vsmetaInfo.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ def __init__(self):
1010
self.year = 0
1111
self.episodeReleaseDate = date(1900, 1, 1)
1212
self.tvshowReleaseDate = date(1900, 1, 1)
13-
self.tvshowYear = 0,
14-
self.tvshowSummary = "",
15-
self.chapterSummary = "",
16-
self.classification = 0,
17-
self.season = 0,
18-
self.episode = 0,
19-
self.rating = -1.0,
20-
self.list = VsMetaListInfo(),
21-
self.images = VsMetaImageInfo(),
13+
self.tvshowYear = 0
14+
self.tvshowSummary = ""
15+
self.chapterSummary = ""
16+
self.classification = 0
17+
self.season = 0
18+
self.episode = 0
19+
self.rating = -1.0
20+
self.list = VsMetaListInfo()
21+
self.images = VsMetaImageInfo()
2222
self.episodeMetaJson = ""
2323
self.tvshowMetaJson = ""
2424
self.timestamp = date(1900, 1, 1)

0 commit comments

Comments
 (0)