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

Commit f69fbe0

Browse files
authored
Merge pull request #4 from Berfre/encoder-decoder
VsMeta Encoder-Decoder
2 parents abd2a5b + b8c6eb7 commit f69fbe0

30 files changed

+47950
-562
lines changed

README.md

Lines changed: 57 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# About VsMetaFileEncoder
1+
# About VsMetaFileCodec
22
## Summary
33
NAS manufacturer [Synology](https://www.synology.com/) provides, for its network attached storage devices (NAS), a video content manager called *Video Station*. The application enables the NAS to stream videos over your LAN. Information about these videos are stored in a local Postgres database and optionally by files with extension *.vsmeta*. The format is proprietary.
4-
The tool provided here is able to write vsMetaFiles. The structure has been elaborated by reverse engineering and ressources found [here](https://gist.github.com/soywiz/2c10feb1231e70aca19a58aca9d6c16a). Many thanks to [Carlos Ballesteros Velasco](https://github.com/soywiz).
4+
The tool provided here is able to read and write vsMetaFiles. The structure has been elaborated by reverse engineering and resources found [here](https://gist.github.com/soywiz/2c10feb1231e70aca19a58aca9d6c16a). Many thanks to [Carlos Ballesteros Velasco](https://github.com/soywiz).
55

66
## Prerequisites
77
Once a video is written into a directory, *Video Station* looks for *.vsmeta* files if these conditions are met:
88
* The folder is part of a *Video Station* library.
9-
* At least once, an export of meta data has been triggered. This can be done at the library settings of Video Station.
9+
* At least once, an export of metadata has been triggered. This can be done at the library settings of Video Station.
1010
* The *.vsmeta* file has the same name as the video, appended by *.vsmeta*.
11-
Example: The video is called `video.mpg`, the meta data file shall be named `video.mpg.vsmeta`.
11+
Example: The video is called `video.mpg`, the metadata file shall be named `video.mpg.vsmeta`.
1212
* The *.vsmeta* file is available when *Video Station* indexes the video file first time.
1313
* The content type (movie, series, other) is equal to the type specified in the *.vsmeta* file.
1414

1515
## Limitations
1616
* Media type 'others' is currently not supported.
17-
* Some fields are not yet supported. See list below.
17+
* All known fields are supported in this version (See list below).
1818

1919
## How to use the code
2020

@@ -23,8 +23,9 @@ Here's an example piece of code. Other examples can be found in the unit test cl
2323
```python:
2424
2525
import os
26-
from vsmetaEncoder.vsmetaMovieEncoder import VsMetaMovieEncoder
27-
from vsmetaEncoder.vsmetaInfo import VsMetaInfo
26+
from datetime import date
27+
from vsmetaCodec.vsmetaMovieEncoder import VsMetaMovieEncoder
28+
from vsmetaCodec.vsmetaInfo import VsMetaInfo
2829
2930
class writeVsMetaForMovie():
3031
@@ -33,15 +34,15 @@ Here's an example piece of code. Other examples can be found in the unit test cl
3334
writer = VsMetaMovieEncoder()
3435
3536
info = writer.info
36-
info.episodeTitle = 'Nach der Hochzeit'
3737
info.showTitle = 'Kino - Filme'
38-
info.setEpisodeDate(date(2021, 3, 8))
38+
info.episodeTitle = 'Nach der Hochzeit'
39+
info.episodeReleaseDate = date(2021, 3, 8)
3940
info.chapterSummary = 'Um die drohende Schließung seines indischen Waisenhauses abzuwenden...'
4041
4142
writeVsMetaFile(os.path.join(os.path.dirname(os.path.realpath(__file__)),'videp.mp4.vsmeta'), writer.encode(info))
4243
```
4344

44-
The code is available on PyPI and can be installed with command `pip install vsMetaEncoder`.
45+
The code will be available on PyPI soon and can be installed with command `pip install vsMetaCodec`.
4546

4647

4748
# Field mapping
@@ -50,54 +51,61 @@ Here's how to use the vsMetaInfo class for the different media types.
5051

5152
## Series
5253

53-
To encode the episode of a series, use the `vsMetaInfo` class with a `vsMetaSeriesEncoder`. Have a look at the test classes to see how it works best. The table below describes how to set the `vsMetaInfo` properties.
54-
55-
Field in Video Station | vsMetaInfo property | Remark
56-
---------------------- | ------------------- | ----------------
57-
TV Show Name | `showTitle`
58-
Publishing Date | `setEpisodeReleaseDate()` | Use method instead of direct value assignment.
59-
Episode Title | `episodeTitle`
60-
Season | `season` | If not set, defaulted with publishing year of episode.
61-
Episode | `episode` | If not set, defaulted with week number x 10 plus weekday number (Monday is 1).
62-
Publishing Date (Episode)| `setShowDate()` | Use method instead of direct value assignment.
63-
Locked | `episodeLocked`
64-
Summary | `chapterSummary`
65-
66-
Not supported yet:
67-
68-
* Classification
69-
* Rating
70-
* Genre
71-
* Cast
72-
* Author
54+
To encode the episode of a series, use the `vsMetaInfo` class with a `vsMetaSeriesEncoder`.
55+
Have a look at the test classes to see how it works best. The table below describes how to set the `vsMetaInfo` properties.
56+
57+
| Field in Video Station | vsMetaInfo property | Remark |
58+
|---------------------------|---------------------------|-----------------------------------------------------------------------------|
59+
| TV Show Name | `showTitle` | assign any tv show name as text of type 'str' |
60+
| Episode Title | `episodeTitle` | assign any text of type 'str' |
61+
| Publishing Date | `episodeReleaseDate` | assign any date of type 'date' or 'str' in ISO format |
62+
| Season | `season` | type int: If not set, defaulted with publishing year of episode. |
63+
| Episode | `episode` | type int: If not set, defaulted with week no. x 10 + weekday no. (Monday=1) |
64+
| Publishing Date (Episode) | `tvshowReleaseDate` | assign any date of type 'date' or 'str' in ISO format |
65+
| Poster (of Serie) | `posterImageInfo.image` | assign a jpg-image as bytestring (the md5-hash is calculated automatically) |
66+
| Locked | `episodeLocked` | assign 'True' if 'VideoStation' may not alter the vsmeta file content |
67+
| Summary | `chapterSummary` | assign any text of type 'str' |
68+
| Classification | `classification` | assign any text of type 'str' |
69+
| Rating | `rating` | assign any float value in the range of 0.0. to 10.0 or -1.0 for unknown |
70+
| Cast | `list.cast[]` | append 'actor names' of type 'str' to the list |
71+
| Genre | `list.genre[]` | append 'genres' of type 'str' to the list, e.g. 'Drama', 'Action' |
72+
| Director | `list.director[]` | append 'director names' of type 'str' to the list |
73+
| Writer | `list.writer[]` | append 'author names' of type 'str' to the list |
74+
| Poster (of Episode) | `episodeImageInfo.image` | assign a jpg-image as bytestring (the md5-hash is calculated automatically) |
75+
| Background (of Serie) | `backdropImageInfo.image` | assign a jpg-image as bytestring (the md5-hash is calculated automatically) |
7376

7477
## Movies
7578

76-
To encode a TV film or movie, use the `vsMetaInfo` class with a `vsMetaMoviesEncoder`. The property names might be confusing, don't think too much about it - just use them as listed below.
77-
78-
Field in Video Station | vsMetaInfo property | Remark
79-
---------------------- | ------------------- | ----------------
80-
Title | `showTitle`
81-
Short Title | `episodeTitle`
82-
Publishing Date | `setEpisodeDate()` | Use method instead of direct value assignment.
83-
Locked | `episodeLocked`
84-
Summary | `chapterSummary`
85-
86-
Not supported yet:
87-
88-
* Classification
89-
* Rating
90-
* Genre
91-
* Cast
92-
* Author
79+
To encode a TV film or movie, use the `vsMetaInfo` class with a `vsMetaMoviesEncoder`.
80+
The property names might be confusing, don't think too much about it - just use them as listed below.
81+
82+
| Field in Video Station | vsMetaInfo property | Remark |
83+
|---------------------------|---------------------------|-----------------------------------------------------------------------------|
84+
| Title | `showTitle` | assign any title text of type 'str' |
85+
| Short Title | `episodeTitle` | assign any short title text of type 'str' |
86+
| Publishing Date | `episodeReleaseDate` | assign any date of type 'date' or 'str' in ISO format |
87+
| Season | `season` | N/A - not used, set to 0 |
88+
| Episode | `episode` | N/A - not used, set to 0 |
89+
| Publishing Date (Episode) | `tvshowReleaseDate` | N/A - not used, set to 1900-01-01 |
90+
| Poster (of Serie) | `posterImageInfo.image` | N/A - not used, set to VsImageInfo() |
91+
| Locked | `episodeLocked` | assign 'True' if 'VideoStation' may not alter the vsmeta file content |
92+
| Summary | `chapterSummary` | assign any text of type 'str' |
93+
| Classification | `classification` | assign any text of type 'str' |
94+
| Rating | `rating` | assign any float value in the range of 0.0. to 10.0 or -1.0 for unknown |
95+
| Cast | `list.cast[]` | append 'actor names' of type 'str' to the list |
96+
| Genre | `list.genre[]` | append 'genres' of type 'str' to the list, e.g. 'Drama', 'Action' |
97+
| Director | `list.director[]` | append 'director names' of type 'str' to the list |
98+
| Writer | `list.writer[]` | append 'author names' of type 'str' to the list |
99+
| Poster (of Movie) | `episodeImageInfo.image` | assign a jpg-image as bytestring (the md5-hash is calculated automatically) |
100+
| Background (of Movie) | `backdropImageInfo.image` | assign a jpg-image as bytestring (the md5-hash is calculated automatically) |
93101

94102
## Media type 'other'
95103

96104
This media type is not supported, and probably won't. It is intended for private videos or artwork, which will be edited most likely manually at uploading.
97105

98-
## Screen shots of the property screens for the media types
106+
## Screenshots of the property screens for the media types
99107

100-
Here are the screenshots of the supported media types in German English (I did not had English screenshots at hand - please add them if you have).
108+
Here are the screenshots of the supported media types in German English (I did not have English screenshots at hand - please add them if you have).
101109

102110
![Properties of series](doc/properties_series.png) ![Properties of movies](doc/properties_movie.png)
103111

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[build-system]
2+
requires = ["setuptools>=68.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "vsmetaEncoder"
7+
version = "0.9.1"
8+
authors = [
9+
{ name="Thomas Meder", email="[email protected]" },
10+
{ name="Bernd Frey", email="[email protected]" },
11+
12+
]
13+
description = "A module to encode and decode media information with Synology's vsmeta file format."
14+
readme = "README.md"
15+
requires-python = ">=3.8"
16+
classifiers=[
17+
"Programming Language :: Python :: 3",
18+
"License :: OSI Approved :: MIT License",
19+
"Operating System :: OS Independent",
20+
"Topic :: System :: Logging",
21+
]
22+
23+
[project.urls]
24+
Homepage = "https://github.com/Berfre/vsMetaFileCodec"
25+
Issues = "https://github.com/Berfre/vsMetaFileCodec/issues"

src/setup.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
with open("README.md", "r", encoding="utf-8") as fh:
44
long_description = fh.read()
55

6-
setuptools.setup(name='vsmetaEncoder',
7-
version='0.9',
8-
description='A module to encode media information with Synology\'s vsmeta file format.',
6+
setuptools.setup(
7+
name='vsmetaCodec',
8+
version='0.9.1',
9+
description='A module to encode and decode media information with Synology\'s vsmeta file format.',
910
long_description=long_description,
1011
long_description_content_type="text/markdown",
11-
url='https://github.com/TomMeHo/vsMetaFileEncoder',
12-
author='Thomas Meder',
13-
author_email='[email protected]',
12+
url='https://github.com/berfre/vsMetaFileCodec',
13+
author='Bernd Frey',
14+
author_email='[email protected]',
1415
license='BSD',
1516
packages=setuptools.find_packages(),
1617
zip_safe=False,
@@ -24,4 +25,4 @@
2425
"Topic :: System :: Logging"
2526
],
2627
python_requires='>=3.6'
27-
)
28+
)

0 commit comments

Comments
 (0)