Set Media Metadata
552483
protected function setMediaMetadata()
    {
        $mediaMetadata = $this->getDataProperty('metadata');
        if (is_array($mediaMetadata)) {
            if ($mediaMetadata['.tag'] === 'photo') {
                //Media is Photo
                $this->mediaMetadata = new PhotoMetadata($mediaMetadata);
            } elseif ($mediaMetadata['.tag'] === 'video') {
                //Media is Video
                $this->mediaMetadata = new VideoMetadata($mediaMetadata);
            } else {
                //Unknown Media (Quite unlikely, though.)
                $this->mediaMetadata = new MediaMetadata($mediaMetadata);
            }
        }
    }
487601
public function metaData()
    {
        Meta::setTitle($this->fullName)
            ->set("description", $this->about)
            ->set("og:type", "profile", "property")
            ->set("og:title", $this->fullName, "property")
            ->set("og:description", $this->about, "property")
            ->set("og:url", $this->href, "property")
            ->setImageOG($this->profileImage)
            ->setProfileOG($this)
            ->setHrefLangData($this)
            ->setCanonical($this->href)
            ->setWildcards(
                [
                '{{firstName}}' => $this->firstName,
                '{{lastName}}' => $this->lastName,
                '{{title}}' => $this->firstName . " " . $this->lastName,
                '{{sitename}}' => settings('siteTitle')
                ]
            );
    }
621392
def store_media(self, filename, mediafile):
        """"""
        filename = os.path.join(
            self.img_dir,
            filename
        )
        fileops.create_dirs(
            os.path.dirname(filename)
        )
        mediafile.fetch_to_file(filename)
904043
def set_metadata(self, key: str, value: str):
        
        if not isinstance(key, str) or not isinstance(value, str):
            raise TypeError("'key' and 'value' of metadata MUST be strings")
        self.metadata[key] = value
73118
def _put_metadata(self, fs_remote, ds):
        """"""

        from six import text_type
        from fs.errors import ResourceNotFoundError


        identity = ds.identity
        d = identity.dict

        d['summary'] = ds.config.metadata.about.summary
        d['title'] = ds.config.metadata.about.title

        meta_stack = self._meta_infos(ds)

        def do_metadata():
            for path, ident in meta_stack:
                fs_remote.setcontents(path, ident)


        try:
            # Assume the directories already exist
            do_metadata()
        except ResourceNotFoundError:
            # Nope, make them and try again.
            parts = ['vid', 'id', 'vname', 'name']
            for p in parts:
                dirname = os.path.join('_meta', p)
                fs_remote.makedir(dirname, allow_recreate=True, recursive=True)

            do_metadata()
129077
def _set_blob_metadata(self, ud, metadata):
        # type: (Uploader, blobxfer.models.upload.Descriptor, dict) -> None
        
        blobxfer.operations.azure.blob.set_blob_metadata(ud.entity, metadata)
        if blobxfer.util.is_not_empty(ud.entity.replica_targets):
            for ase in ud.entity.replica_targets:
                blobxfer.operations.azure.blob.set_blob_metadata(ase, metadata)
1247223
def set(self, media, _bytes, overwrite=True, b64encode=False):
        
        data = base64.b64encode(_bytes) if b64encode else Binary(_bytes)
        self._dokuwiki.send('wiki.putAttachment', media, data, ow=overwrite)
233675
def add_metadata_to_archive(self, metadata, meta_path):
        '''
        
        '''
        archive_path = self.get_full_archive_path(meta_path.lstrip('/'))
        write_data_to_file(metadata, archive_path)
594088
def set_metadata(self, metadata):
        
        if metadata is not None:
            metadata = np.array(metadata, copy=False).ravel()
        self.metadata = metadata
146949
public function setMetadata(string $metadata): void
    {
        $this->isValidString($metadata, 1000);

        $this->metadata = $metadata;
    }
948484
@SuppressWarnings("deprecation")
    public void setMetaData(SoundCloudTrack track, Bitmap artwork) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {

            // set meta data on the lock screen for pre lollipop.
            mRemoteControlClientCompat.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
            RemoteControlClientCompat.MetadataEditorCompat mediaEditorCompat
                    = mRemoteControlClientCompat.editMetadata(true)
                    .putString(MediaMetadataRetriever.METADATA_KEY_TITLE, track.getTitle())
                    .putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, track.getArtist());
            if (artwork != null) {
                mediaEditorCompat.putBitmap(
                        RemoteControlClientCompat.MetadataEditorCompat.METADATA_KEY_ARTWORK, artwork);
            }
            mediaEditorCompat.apply();
        }

        // set meta data to the media session.
        MediaMetadataCompat.Builder metadataCompatBuilder = new MediaMetadataCompat.Builder()
                .putString(MediaMetadataCompat.METADATA_KEY_TITLE, track.getTitle())
                .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, track.getArtist());
        if (artwork != null) {
            metadataCompatBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART, artwork);
        }
        mMediaSession.setMetadata(metadataCompatBuilder.build());
        setMediaSessionCompatPlaybackState(PlaybackStateCompat.STATE_PLAYING);
    }
500335
def _update_metadata_for_video(self, metadata_href, video):
        '''
        
        '''
        current_metadata = self.clarify_client.get_metadata(metadata_href)
        cur_data = current_metadata.get('data')

        if cur_data.get('updated_at') != video['updated_at']:
            self.log('Updating metadata for video {0}'.format(video['id']))
            if not self.dry_run:
                metadata = self._metadata_from_video(video)
                self.clarify_client.update_metadata(metadata_href, metadata=metadata)
            self.sync_stats['updated'] += 1
158205
public T setMedia(InputStream mediaStream, String fileName) {
        this.newMediaStream = mediaStream;
        this.isNewMedia = true;
        this.mediaName = fileName;
        this.media = "attach://" + fileName;
        return (T) this;
    }
63173
public void setMetadata(com.google.api.ads.admanager.axis.v201805.VideoMetadata metadata) {
        this.metadata = metadata;
    }
741691
def _set_blob_metadata(self, sd, metadata):
        # type: (SyncCopy, blobxfer.models.synccopy.Descriptor, dict) -> None
        
        blobxfer.operations.azure.blob.set_blob_metadata(
            sd.dst_entity, metadata)
        if blobxfer.util.is_not_empty(sd.dst_entity.replica_targets):
            for ase in sd.dst_entity.replica_targets:
                blobxfer.operations.azure.blob.set_blob_metadata(ase, metadata)
880503
def set_metadata(self, queue, metadata, clear=False):
        
        return self._manager.set_metadata(queue, metadata, clear=clear)
29629
public function metaData()
    {
        Meta::setTitle($this->label)
        //            ->set("og:type", "article", "property")
        //            ->set("og:title", $this->label, "property")
        //            ->set("og:description", $this->content(), "property")
            ->set("og:url", $this->href, "property")
        //            ->setImageOG(($this->hasFeaturedImage() ? $this->featuredImage : null))
        //            ->setArticleOG($this)
        //            ->setHrefLangData($this)
            ->setCanonical($this->href)
            ->setWildcards(
                [
                '{{title}}' => $this->label,
                '{{sitename}}' => settings('siteTitle')
                ]
            );

        return;
    }