2022-11-21 16:55:25 +00:00
|
|
|
Class {
|
|
|
|
#name : #PaqueteSemanal,
|
|
|
|
#superclass : #Object,
|
|
|
|
#instVars : [
|
|
|
|
'location',
|
|
|
|
'repository'
|
|
|
|
],
|
2022-11-21 17:26:32 +00:00
|
|
|
#classInstVars : [
|
|
|
|
'location'
|
|
|
|
],
|
2022-11-21 16:55:25 +00:00
|
|
|
#category : #PaqueteSemanal
|
|
|
|
}
|
2022-11-21 17:26:32 +00:00
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
PaqueteSemanal class >> location: anObject [
|
|
|
|
location := anObject
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
PaqueteSemanal >> extractMetadataForFolder: subfolder [
|
|
|
|
|
|
|
|
| subfolderFiles extractMetadatos |
|
|
|
|
subfolderFiles := subfolder allChildren select: [:item | item isFile and: [(item basename = '.DS_Store') not ]].
|
|
|
|
subfolderFiles do: [:archivoPruebas | | metadatosArchivo titulo metaTiddler |
|
|
|
|
extractMetadatos := GtSubprocessWithInMemoryOutput new
|
|
|
|
command: '/usr/local/bin/exiftool';
|
|
|
|
arguments: { '-j' . archivoPruebas fullName}.
|
|
|
|
extractMetadatos errorBlock: [ :proc | self error: 'Failed to run exiftool' ].
|
|
|
|
extractMetadatos runAndWait.
|
|
|
|
metadatosArchivo := extractMetadatos stdout.
|
|
|
|
"metadatosArchivo."
|
|
|
|
titulo := archivoPruebas basename.
|
|
|
|
metaTiddler := Tiddler new
|
|
|
|
title: titulo;
|
|
|
|
text: metadatosArchivo;
|
|
|
|
type: 'application/json'.
|
|
|
|
MarkupFile
|
|
|
|
exportAsFileOn: (self metadataFolder / titulo, 'json')
|
|
|
|
containing: metaTiddler asJson
|
|
|
|
].
|
|
|
|
^ self metadataFolder
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
PaqueteSemanal >> location: anObject [
|
|
|
|
location := anObject
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
PaqueteSemanal >> metadataFolder [
|
|
|
|
^ self repository / 'metadatos'
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
PaqueteSemanal >> repository [
|
|
|
|
^ repository
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
PaqueteSemanal >> repository: folder [
|
|
|
|
repository := folder
|
|
|
|
]
|