Commit 30c0180
Google media exporter: installs along side Photos, but will replace photos in the future (#1218)
`GoogleMediaExporter` class mosty written by seehamrun@ with later additional commits by jzacsh@
* Create MediaContainerResource to be used by the new MediaExporters and MediaImporters
This combines the photo and video resources
* Account for videos in the transmogrification logic
* Fix typo in the Transmogrification config
* Add Video limits to transmogrification config
* add clean title to the transmogrification config for videos
* undo rename of the videomodel (let this get handled when the PR to rename gets pushed)
* fix warning abut overriding equals but not hashcode
* remove logic to split up the albums in the media resource
* slight fix to the transmogrification function -- move up the root album to the main function
* Update MediaContainer to use the new VideoModel instead of VideoObject
* Use Album and Video transmogrification specific variables
* Fix return case when maxLength <= 0
* Initial skeleton of the GoogleMediaExporter
This is currently just a copy of the GooglePhotosExporter without all of the content for exporting videos
* Hookup the mediaexporter to the transfer extension
* Add support for video exports in the GoogleMediaExporter
* fix importer
* move convertToVideoModel and convertToPhotoModel into the GoogleMediaItem class
* use getFileName as the title for videos
* Rename PopulateContainedPhotosList method to PopulateContainedMediaList
* Rename `exportPhotos` to `exportMedia`
* Add video support for the exportMediaContainerResource function
jzacsh@'s continued commits:
* fix broken tests: have new data & exceptions
both video and photo models have a new "upload time" field so this
commit _starts_ to introduce that.
also tweaked some of the existing code that was written before
Upload...Exception was added to some signatures.
* nit: consistency in inline-documentation
* nit: stick to existing pattern (of always having a setter)
* noop(docs) leave trail to cleanup since this PR is forking code
* noop(refactor) mv Temp{Photo,Media}Data
noop as this is just a rename of current temp-store logic that is
hardcoded to Photos. Later work will come along to extend the
TempMediaData object to handle new data (added TODO to this point atop
the class).
* WIP: fork of Photos tests trivial "passing"
* noop(refactor) make name match the forked purpose of this token prefix
* WIP: sets roadmap to complete unit test
comparing to the history of the forked Exporter _itself_ - the core
thing that changed was adding video, but most of the code stayed
identical. this unit test then leaves the core "photo set" unit test in
place and simply adds another for video, trying to mirror the fork of
the exporter itself as closely as possible.
* noop(prefactor) clarify photo-logic in tests
this clarifies what the photo-specific fakes are between a unit test's
arrange and assert phases. that's not always clear for _other_ consts
that are pulled to the top of the test file, but I'm trying to merely
unblock the addition of video logic here (not do a _general_ cleanup).
* bugfix: all the fakes should be readonly
* finishes unit test by fixing URL assertion
while I'm at it, also refactoring the Media objects involved so google
adapter logic isn't doing deep property-null-checking as an API (`isVideo`
`isPhoto`).
---------
Co-authored-by: Siham Hussein <sihamh@google.com>1 parent 3e33a07 commit 30c0180
11 files changed
Lines changed: 986 additions & 97 deletions
File tree
- extensions/data-transfer
- portability-data-transfer-google/src
- main/java/org/datatransferproject/datatransfer/google
- mediaModels
- media
- photos
- videos
- test/java/org/datatransferproject/datatransfer/google
- media
- photos
- portability-data-transfer-imgur/src/main/java/org/datatransferproject/datatransfer/imgur/photos
- portability-spi-transfer/src/main/java/org/datatransferproject/spi/transfer/types
- portability-types-common/src/main/java/org/datatransferproject/types/common/models/media
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| 137 | + | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
Lines changed: 422 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 107 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
49 | 58 | | |
50 | | - | |
51 | 59 | | |
52 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
53 | 70 | | |
54 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
55 | 85 | | |
56 | | - | |
57 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
58 | 132 | | |
59 | 133 | | |
60 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
61 | 137 | | |
62 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
63 | 141 | | |
64 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
65 | 147 | | |
66 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
67 | 151 | | |
68 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
69 | 155 | | |
70 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
71 | 159 | | |
72 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
73 | 163 | | |
Lines changed: 14 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | | - | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
277 | | - | |
278 | | - | |
| 279 | + | |
| 280 | + | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
| |||
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
296 | | - | |
| 298 | + | |
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
| |||
305 | 307 | | |
306 | 308 | | |
307 | 309 | | |
308 | | - | |
| 310 | + | |
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
| |||
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
335 | | - | |
| 337 | + | |
336 | 338 | | |
337 | 339 | | |
338 | | - | |
| 340 | + | |
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
| |||
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
347 | | - | |
348 | | - | |
| 349 | + | |
| 350 | + | |
349 | 351 | | |
350 | 352 | | |
351 | 353 | | |
352 | | - | |
| 354 | + | |
353 | 355 | | |
354 | 356 | | |
355 | 357 | | |
| |||
360 | 362 | | |
361 | 363 | | |
362 | 364 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | 365 | | |
377 | 366 | | |
378 | 367 | | |
| |||
385 | 374 | | |
386 | 375 | | |
387 | 376 | | |
388 | | - | |
| 377 | + | |
389 | 378 | | |
390 | 379 | | |
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments