Skip to content

Commit 210ba24

Browse files
committed
Merge branch 'develop' into 11376-add-version-note-to-diff-summary
2 parents 59f6a6b + c687d18 commit 210ba24

File tree

8 files changed

+58
-12
lines changed

8 files changed

+58
-12
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
### video subtitles (vtt files)
2+
3+
The `IQSS/dataverse` PR sets the content type for new(!) files with extension `vtt` to `text/vtt`
4+
what is presented as "_Web Video Text Tracks_". The PR also enables full text indexing for these files,
5+
if [configured](https://guides.dataverse.org/en/latest/installation/config.html#solrfulltextindexing).
6+
7+
The `gdcc/dataverse-previewer` PRs provide a new version of the video previewer.
8+
The new previewer version presents `vtt` files as subtitles for videos,
9+
the naming convention is `<video-basename>.<language-tag>.vtt`.
10+
The previewer does not rely on the content type.
11+
A proper content type may hint users to ask permission for the subtitles together with a video.
12+
13+
Existing files with extension `vtt` will keep content type `application/octet-stream` presented as "_Unknown_".
14+
The following query shows the number of files per extension with an "_Unknown_" content type:
15+
16+
SELECT substring(m.label from (length(label) - strpos(reverse(m.label), '.') + 2)) AS extension, COUNT(*) as count
17+
FROM datafile f LEFT JOIN filemetadata m ON f.id = m.datafile_id
18+
WHERE f.contenttype = 'application/octet-stream'
19+
GROUP BY extension;
20+
21+
If `vtt` does not appear in the result, you are done.
22+
Otherwise, you may want to update the content type for existing files and reindex those datasets.
23+
24+
First figure out which datasets would need [reindexing](https://guides.dataverse.org/en/latest/admin/solr-search-index.html#manual-reindexing):
25+
26+
select distinct
27+
o.protocol, o.authority, o.identifier,
28+
v.versionnumber, v.minorversionnumber, v.versionstate
29+
from datafile f
30+
left join filemetadata m on f.id = m.datafile_id
31+
left join datasetversion v on v.id = m.datasetversion_id
32+
left join dvobject o on o.id = v.dataset_id
33+
WHERE contenttype = 'application/octet-stream'
34+
AND 'vtt' = substring(m.label from (length(label) - strpos(reverse(m.label), '.') + 2))
35+
;
36+
37+
Then update the content type for the files:
38+
39+
UPDATE datafile SET contenttype = 'text/vtt' WHERE id IN (
40+
SELECT datafile_id FROM filemetadata m
41+
WHERE contenttype = 'application/octet-stream'
42+
AND 'vtt' = substring(m.label from (length(label) - strpos(reverse(m.label), '.') + 2))
43+
);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Backward Incompatibilities
2+
3+
An undocumented Search API parameter called "show_my_data" has been removed. It was never exercised by tests and is believed to be unused. API users should use the [MyData] API instead. See the [API changelog](https://dataverse-guide--11375.org.readthedocs.build/en/11375/api/changelog.html), #11287 and #11375.

doc/sphinx-guides/source/api/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ This API changelog is experimental and we would love feedback on its usefulness.
77
:local:
88
:depth: 1
99

10+
v6.7
11+
----
12+
13+
- An undocumented :doc:`search` parameter called "show_my_data" has been removed. It was never exercised by tests and is believed to be unused. API users should use the :ref:`api-mydata` API instead.
14+
1015
v6.6
1116
----
1217

doc/sphinx-guides/source/api/native-api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7434,6 +7434,8 @@ As a superuser::
74347434
74357435
Note that this API is probably only useful for testing.
74367436
7437+
.. _api-mydata:
7438+
74377439
MyData
74387440
------
74397441

src/main/java/edu/harvard/iq/dataverse/api/Search.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public Response search(
6666
@QueryParam("fq") final List<String> filterQueries,
6767
@QueryParam("show_entity_ids") boolean showEntityIds,
6868
@QueryParam("show_api_urls") boolean showApiUrls,
69-
@QueryParam("show_my_data") boolean showMyData,
7069
@QueryParam("query_entities") boolean queryEntities,
7170
@QueryParam("metadata_fields") List<String> metadataFields,
7271
@QueryParam("geo_point") String geoPointRequested,
@@ -97,8 +96,8 @@ public Response search(
9796
objectTypeCountsMap.put(SearchConstants.UI_DATASETS, 0L);
9897
objectTypeCountsMap.put(SearchConstants.UI_FILES, 0L);
9998

100-
// users can't change these (yet anyway)
101-
boolean dataRelatedToMe = showMyData; //getDataRelatedToMe();
99+
// hard-coded to false since dataRelatedToMe is only used by MyData (DataRetrieverAPI)
100+
boolean dataRelatedToMe = false;
102101

103102
try {
104103
// we have to add "" (root) otherwise there is no permissions check
@@ -290,15 +289,6 @@ public boolean tokenLessSearchAllowed() {
290289
return tokenLessSearchAllowed;
291290
}
292291

293-
private boolean getDataRelatedToMe() {
294-
/**
295-
* @todo support Data Related To Me:
296-
* https://github.com/IQSS/dataverse/issues/1299
297-
*/
298-
boolean dataRelatedToMe = false;
299-
return dataRelatedToMe;
300-
}
301-
302292
private int getNumberOfResultsPerPage(int numResultsPerPage) {
303293
/**
304294
* @todo should maxLimit be configurable?

src/main/java/propertyFiles/MimeTypeDetectionByFileExtension.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ mat=application/matlab-mat
1616
md=text/markdown
1717
mp3=audio/mp3
1818
m4a=audio/mp4
19+
vtt=text/vtt
1920
nii=image/nii
2021
nc=application/netcdf
2122
ods=application/vnd.oasis.opendocument.spreadsheet

src/main/java/propertyFiles/MimeTypeDisplay.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ video/x-m4v=MPEG-4 Video
217217
video/ogg=OGG Video
218218
video/quicktime=Quicktime Video
219219
video/webm=WebM Video
220+
text/vtt=Web Video Text Tracks
220221
# Network Data
221222
text/xml-graphml=GraphML Network Data
222223
# 3D Data

src/main/java/propertyFiles/MimeTypeFacets.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ text/richtext=Text
3030
text/turtle=Text
3131
application/xml=Text
3232
text/xml=Text
33+
text/vtt=Text
3334
# Code
3435
text/x-c=Code
3536
text/x-c++src=Code

0 commit comments

Comments
 (0)