kapsikkum-unmanic – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3  
4 """
5 unmanic.base_containers.py
6  
7 Written by: Josh.5 <jsunnex@gmail.com>
8 Date: 10 Sep 2019, (8:13 PM)
9  
10 Copyright:
11 Copyright (C) Josh Sunnex - All Rights Reserved
12  
13 Permission is hereby granted, free of charge, to any person obtaining a copy
14 of this software and associated documentation files (the "Software"), to deal
15 in the Software without restriction, including without limitation the rights
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 copies of the Software, and to permit persons to whom the Software is
18 furnished to do so, subject to the following conditions:
19  
20 The above copyright notice and this permission notice shall be included in all
21 copies or substantial portions of the Software.
22  
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
29 OR OTHER DEALINGS IN THE SOFTWARE.
30  
31 """
32  
33  
34 class Containers(object):
35 """
36 Containers
37  
38 Generic configuration and methods used across all Containers classes
39 """
40  
41 def container_extension(self):
42 """
43 Return the container's extension string
44  
45 :return:
46 """
47 return self.extension
48  
49 def container_description(self):
50 """
51 Return the container's description string
52  
53 :return:
54 """
55 return self.description
56  
57 def container_supports_subtitles(self):
58 """
59 Check if this Container supports subtitles
60  
61 :return:
62 """
63 if hasattr(self, 'supports_subtitles'):
64 if self.supports_subtitles:
65 return True
66 return False
67  
68 def supported_subtitles(self):
69 """
70 Check if this Container supports subtitles
71  
72 :return:
73 """
74 if self.container_supports_subtitles():
75 return self.subtitle_codecs
76 return []
77  
78 def unsupported_subtitles(self):
79 """
80 Check if this Container supports subtitles
81  
82 :return:
83 """
84 if hasattr(self, 'unsupports_codecs'):
85 return self.unsubtitle_codecs
86 # HDMV streams cannot be written by FFMPEG
87 return ['hdmv_pgs_subtitle']