Difference between revisions of "Truxton artifact set media id"

From truxwiki.com
Jump to navigation Jump to search
 
Line 15: Line 15:
  
 
=Remarks=
 
=Remarks=
This identifier should be a value from the <code>[ID]</code> column of the <code>[Media]</code> table in the database.
+
This identifier should be a value from the <code>[ID]</code> column of the <code><nowiki>[</nowiki>[[Media Table|Media]]<nowiki>]</nowiki></code> table in the database.
  
 
=Sample=
 
=Sample=

Latest revision as of 07:50, 3 February 2024

This sets the source media of the artifact.

Syntax

void truxton_artifact_set_media_id( uint64_t artifact_handle, char const * id );

Parameters

artifact_handle

The handle to an artifact created by the truxton_artifact_create call.

id

The string representation of a GUID. It corresponds to the [MediaID] column of the [Entity] table.

Remarks

This identifier should be a value from the [ID] column of the [Media] table in the database.

Sample

void create_artifact( char const * file_id, char const * media_id )
{
   uint64_t truxton = truxton_create();

   uint64_t artifact= truxton_artifact_create(truxton);

   truxton_artifact_set_file_id( artifact, file_id );
   truxton_artifact_set_media_id( artifact, media_id );
   truxton_artifact_set_name( artifact, "Ducky Momo Server" );
   truxton_artifact_save( artifact);
   truxton_artifact_tag( artifact, "Too Young", "Yes, yes I am", 1 );

   char id[ 65 ];

   truxton_artifact_get_id( artifact, id, sizeof( id ) );

   printf( "Artifact ID is %s\n", id );

   truxton_artifact_destroy( artifact );
   truxton_destroy( truxton );
}