Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,17 @@ public MicrosoftMediaImporter(String baseUrl, OkHttpClient client, ObjectMapper
TemporaryPerJobDataStore jobStore, Monitor monitor,
MicrosoftCredentialFactory credentialFactory) {

createFolderUrl = baseUrl + "/v1.0/me/drive/special/photo-video/children";
// NOTE: "special/photos" is a specific folder in One Drive that corresponds to items that
// should appear in https://photos.onedrive.com/, for more information see:
// https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_get_specialfolder?#special-folder-names
createFolderUrl = baseUrl + "/v1.0/me/drive/special/photos/children";
albumlessMediaUrlTemplate =
baseUrl + "/v1.0/me/drive/special/photos:/%s:/createUploadSession%s";

// first param is the folder id, second param is the file name
// /me/drive/items/{parent-id}:/{filename}:/content;
uploadMediaUrlTemplate = baseUrl + "/v1.0/me/drive/items/%s:/%s:/createUploadSession%s";
albumlessMediaUrlTemplate =
baseUrl + "/v1.0/me/drive/special/photo-video:/%s:/createUploadSession%s";


this.client = client;
this.objectMapper = objectMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void testCleanAlbumNames() throws Exception {
}

return r.url().toString().equals(
"https://www.baseurl.com/v1.0/me/drive/special/photo-video/children")
"https://www.baseurl.com/v1.0/me/drive/special/photos/children")
&& body.contains("album1_");
}));
Response response = mock(Response.class);
Expand Down Expand Up @@ -151,7 +151,7 @@ public void testImportItemPermissionDenied() throws Exception {
doReturn(call).when(client).newCall(
argThat((Request r)
-> r.url().toString().equals(
"https://www.baseurl.com/v1.0/me/drive/special/photo-video/children")));
"https://www.baseurl.com/v1.0/me/drive/special/photos/children")));
Response response = mock(Response.class);
ResponseBody body = mock(ResponseBody.class);
when(body.bytes())
Expand Down Expand Up @@ -189,7 +189,7 @@ public void testImportItemAllSuccess() throws Exception {
doReturn(call).when(client).newCall(
argThat((Request r)
-> r.url().toString().equals(
"https://www.baseurl.com/v1.0/me/drive/special/photo-video/children")));
"https://www.baseurl.com/v1.0/me/drive/special/photos/children")));
Response response = mock(Response.class);
ResponseBody body = mock(ResponseBody.class);
when(body.bytes())
Expand Down