MCPcopy Index your code
hub / github.com/diffgram/diffgram / new

Method new

shared/database/video/video.py:177–242  ·  view source on GitHub ↗

TODO Jan 13, 2020 Note clear if we should be saving parent_id or video_parent_file as the relation of a clip to the parent... Overall doesn't really make sense So the thing is we never actually create a file for "original" the only thing tha

(
        session,
        project,
        filename,
        frame_rate,
        frame_count: int,
        width: int,
        height: int,
        directory_id: int,
        parent_file_id: int = None,
        parent_input_id: int = None,  # WIP
        parent_video_split_duration: int = None,
        file_metadata: dict = None,
        ordinal: int = 0
    )

Source from the content-addressed store, hash-verified

175
176 @staticmethod
177 def new(
178 session,
179 project,
180 filename,
181 frame_rate,
182 frame_count: int,
183 width: int,
184 height: int,
185 directory_id: int,
186 parent_file_id: int = None,
187 parent_input_id: int = None, # WIP
188 parent_video_split_duration: int = None,
189 file_metadata: dict = None,
190 ordinal: int = 0
191 ):
192 # Does it make sense for this to be here
193 # or would it make more sense for this to
194 # be in file?
195 """
196 TODO Jan 13, 2020
197 Note clear if we should be saving parent_id
198 or video_parent_file as the relation of a clip to
199 the parent...
200
201 Overall doesn't really make sense
202
203 So the thing is we never actually create a file
204 for "original" the only thing that exists is the input id
205 So not really sure what we would be storing here...
206 can do file.input.parent_input ...
207
208 We could log the parent_input_id somewhere
209 ie to make it easier to group videos in the future
210 directionally that should be ok
211 but we should be careful to understand it's the
212 Input class not File class
213
214 """
215 # print(parent_input_id)
216
217 video = Video(
218 filename = filename,
219 frame_rate = frame_rate,
220 frame_count = frame_count,
221 width = width,
222 height = height,
223 parent_video_split_duration = parent_video_split_duration
224 )
225
226 # File will want the ID right away
227 session.add(video)
228 session.flush()
229
230 file = File.new(
231 session = session,
232 project_id = project.id,
233 working_dir_id = directory_id,
234 file_type = "video",

Callers

nothing calls this directly

Calls 2

VideoClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected