2017-06-20 04:34:34 +02:00
|
|
|
const logger = require('winston');
|
2017-07-24 01:52:16 +02:00
|
|
|
const licenses = ['Creative Commons', 'Public Domain', 'CC Attribution-NonCommercial 4.0 International'];
|
2017-06-17 22:51:30 +02:00
|
|
|
module.exports = ({ value }) => {
|
2017-06-20 04:34:34 +02:00
|
|
|
logger.debug('checking isFreePublicClaim ?');
|
2017-06-17 22:51:30 +02:00
|
|
|
if (
|
2017-07-24 01:52:16 +02:00
|
|
|
(Array.asList(licenses).contains(value.stream.metadata.license)) &&
|
2017-06-17 22:51:30 +02:00
|
|
|
(!value.stream.metadata.fee || value.stream.metadata.fee.amount === 0)
|
|
|
|
) {
|
2017-06-19 18:37:35 +02:00
|
|
|
return true;
|
2017-06-17 22:51:30 +02:00
|
|
|
} else {
|
2017-06-19 18:37:35 +02:00
|
|
|
return false;
|
2017-06-17 22:51:30 +02:00
|
|
|
}
|
2017-06-19 18:37:35 +02:00
|
|
|
};
|