<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2009-05-01:143160</id>
  <title>Ordinary Day</title>
  <subtitle>And it's all your state of mind</subtitle>
  <author>
    <name>Anna the Piper</name>
  </author>
  <link rel="alternate" type="text/html" href="https://annathepiper.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://annathepiper.dreamwidth.org/data/atom"/>
  <updated>2023-11-25T10:05:44Z</updated>
  <dw:journal username="annathepiper" type="personal"/>
  <entry>
    <id>tag:dreamwidth.org,2009-05-01:143160:2044093</id>
    <link rel="alternate" type="text/html" href="https://annathepiper.dreamwidth.org/2044093.html"/>
    <link rel="self" type="text/xml" href="https://annathepiper.dreamwidth.org/data/atom/?itemid=2044093"/>
    <title>Gallery restoration status at 70 percent</title>
    <published>2023-11-25T10:05:44Z</published>
    <updated>2023-11-25T10:05:44Z</updated>
    <category term="screenshots"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;p&gt;I spent a good chunk of today trying to figure out if I could automate some of the work of rebuilding my galleries. Answer: yes, though it took some research to learn how to do!&lt;/p&gt;



&lt;p&gt;Because here&amp;#8217;s the thing y&amp;#8217;all: I had several elements in place that would allow for at least &lt;em&gt;some&lt;/em&gt; of the restoration work to be done in a scripted fashion rather than manually.&lt;/p&gt;



&lt;p&gt;Namely:&lt;/p&gt;



&lt;ol&gt;
&lt;li&gt;A known directory structure&lt;/li&gt;



&lt;li&gt;One or more screenshot files in each directory in the structure&lt;/li&gt;



&lt;li&gt;A known file called metadata.json in each directory, which contained the metadata for all of the screenshots in the same directory, and which contained a known structure that I should be able to parse&lt;/li&gt;
&lt;/ol&gt;



&lt;p&gt;And here&amp;#8217;s the process I&amp;#8217;ve been following to rebuild the galleries:&lt;/p&gt;



&lt;ol&gt;
&lt;li&gt;Work my way forward in chronological order through the broken galleries&lt;/li&gt;



&lt;li&gt;For each one, find the corresponding directory on the server&lt;/li&gt;



&lt;li&gt;Manually import each screenshot in that directory into the WordPress media library&lt;/li&gt;



&lt;li&gt;Review contents of metadata.json, and copy and paste all of the relevant data out of that file onto the files added to the media library&lt;/li&gt;



&lt;li&gt;Using the FileBird plugin, create a new folder in the media library to contain the added files&lt;/li&gt;



&lt;li&gt;Using the FooGallery plugin, create a new gallery using the files in the new FileBird folder&lt;/li&gt;



&lt;li&gt;Add the newly created gallery to the relevant album of galleries, and remove the broken one&lt;/li&gt;



&lt;li&gt;Update the gallery shortcode in the relevant playthrough post from the broken gallery to the new replacement&lt;/li&gt;
&lt;/ol&gt;



&lt;p&gt;So, a lot of steps here, right?&lt;/p&gt;



&lt;p&gt;The problem I wanted to solve was automating steps 3 and 4, because the most time-consuming part of this process has been adding hundreds and hundreds of files into my media library, and copy and pasting the metadata in for them. (And as a reminder: these files weren&amp;#8217;t in the media library already, because the broken galleries had been previously reading all the relevant files and data right off the server file structure. Since I can&amp;#8217;t do that now, I have to pull all of this stuff directly into the WordPress media library.)&lt;/p&gt;



&lt;p&gt;And solving this problem required doing these major things:&lt;/p&gt;



&lt;ol&gt;
&lt;li&gt;Installing &lt;a href="https://make.wordpress.org/cli/handbook/guides/installing/"&gt;wp-cli&lt;/a&gt;, the command line tool for managing WordPress installations&lt;/li&gt;



&lt;li&gt;Learning how to use the &lt;a href="https://developer.wordpress.org/cli/commands/media/import/"&gt;wp media import&lt;/a&gt; command, including how to make it work with a multi-site installation, which is what I have; Anna Plays Skyrim is part of a multi-site WordPress network&lt;/li&gt;



&lt;li&gt;Learning how to use &lt;a href="https://manpages.org/jq"&gt;jq&lt;/a&gt;, which is a command line JSON parser&lt;/li&gt;
&lt;/ol&gt;



&lt;p&gt;I threw some threads out on Mastodon today on the WordPress hashtag, asking for recommendations on how to accomplish what I wanted to do. So now I have a two-command solution to do steps 3 and 4 above, like so.&lt;/p&gt;



&lt;p&gt;For step 3, I&amp;#8217;m running this scary-looking thing which basically chugs through metadata.json in the current working directory, and spits out a full &amp;#8220;wp media import&amp;#8221; command for every file covered in the JSON file. Then it saves that list into temp.sh.&lt;/p&gt;



&lt;pre class="wp-block-code"&gt;&lt;code&gt;jq -r '.items&amp;#91;] | @sh "wp media import \(.file) --caption=\(.caption) --title=\(.caption) --desc=\(.description) --alt=\(.alt) --url=https://skyrim.annathepiper.org/"' metadata.json &amp;gt; temp.sh&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Then I need to run those commands:&lt;/p&gt;



&lt;pre class="wp-block-code"&gt;&lt;code&gt;sh temp.sh&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Lastly, I pop into the media library and confirm that:&lt;/p&gt;



&lt;ol&gt;
&lt;li&gt;All the files in the working directory now appear in the media library&lt;/li&gt;



&lt;li&gt;All the metadata on the files is correct (and I&amp;#8217;m correcting typos where I spot them)&lt;/li&gt;
&lt;/ol&gt;



&lt;p&gt;Then I can proceed to making the FileBird directories and the new galleries.&lt;/p&gt;



&lt;p&gt;So this is still taking some effort; it&amp;#8217;s not just a matter of doing a mass import of the entire directory structure. Which I&amp;#8217;m actually okay with, on the grounds that having to go through each directory &lt;em&gt;is&lt;/em&gt; letting me doublecheck that the files and their metadata are getting imported okay. &lt;em&gt;And&lt;/em&gt; look for any typos I want to fix as well.&lt;/p&gt;



&lt;p&gt;As of this writing, I&amp;#8217;m now at about 70 percent complete on the restoration effort. The &lt;a href="https://skyrim.annathepiper.org/faanshi-playthrough/" data-type="page" data-id="30942"&gt;Faanshi Playthrough&lt;/a&gt; and &lt;a href="https://skyrim.annathepiper.org/shenner-playthrough/" data-type="page" data-id="31002"&gt;Shenner Playthrough&lt;/a&gt; galleries are now done.&lt;/p&gt;



&lt;p&gt;Galleries now in active progress of being fixed are the ones for Gyllerah, Tembriel, Harrowhark, and Kendis.&lt;/p&gt;



&lt;p&gt;More on this tomorrow. And thanks to everybody on Mastodon who offered advice!&lt;/p&gt;
&lt;p style="text-align: right"&gt;&lt;small&gt;Read more on &lt;a href="https://skyrim.annathepiper.org/2023/11/25/gallery-restoration-status-at-70-percent/" title="Read original post."&gt;Anna Plays Skyrim&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=annathepiper&amp;ditemid=2044093" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-01:143160:2043385</id>
    <link rel="alternate" type="text/html" href="https://annathepiper.dreamwidth.org/2043385.html"/>
    <link rel="self" type="text/xml" href="https://annathepiper.dreamwidth.org/data/atom/?itemid=2043385"/>
    <title>Ysani&amp;#8217;s screenshots now restored</title>
    <published>2023-11-22T06:36:10Z</published>
    <updated>2023-11-22T06:36:10Z</updated>
    <category term="screenshots"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;p&gt;Gallery reconstruction work continues on Anna Plays Skryim, and now &lt;a href="https://skyrim.annathepiper.org/screenshots/ysani-demers-screenshots/" data-type="page" data-id="30728"&gt;all galleries&lt;/a&gt; for &lt;a href="https://skyrim.annathepiper.org/ysani-playthrough/" data-type="page" data-id="29324"&gt;Ysani&amp;#8217;s playthrough&lt;/a&gt; have been restored.&lt;/p&gt;



&lt;p&gt;I currently have 576 total galleries (because BOY HOWDY do I have a lot of screenshots for Skyrim, as well as Morrowind, Oblivion, and ESO). Of these, 227 are now confirmed functional. (Alarrah&amp;#8217;s galleries never broke as I had never converted hers over to the gallery type I lost access to, but I&amp;#8217;m counting hers in this count.)&lt;/p&gt;



&lt;p&gt;Which means my galleries currently stand at about 40 percent restored.&lt;/p&gt;



&lt;p&gt;For the time being I&amp;#8217;m putting a pause on playing anything else, while I focus on restoring all these galleries and &lt;em&gt;then&lt;/em&gt; working on writing backlogged posts. So it&amp;#8217;ll be probably at least another week or so before I put up new content. Stand by, y&amp;#8217;all!&lt;/p&gt;



&lt;p&gt;The next round of updates will start working on three playthroughs at once, Faanshi&amp;#8217;s, Shenner&amp;#8217;s, and Tembriel&amp;#8217;s. Because I&amp;#8217;m working my way forward in chronological order through all the galleries as previously created, just because that seems the most orderly way to me to proceed.&lt;/p&gt;



&lt;p&gt;And oh yes, one more aspect of interest to this:&lt;/p&gt;



&lt;p&gt;When I started converting the impacted galleries back to the gallery type that pulls directly out of the WordPress media library, I had a non-zero level of worry that I&amp;#8217;d repro the same problem that broke the galleries back in the middle of Delga&amp;#8217;s playthrough. That issue was basically causing older galleries to lose track of their assigned screenshots.&lt;/p&gt;



&lt;p&gt;I was worried, once I made it into Delga&amp;#8217;s screenshots, that I&amp;#8217;d repro that same issue. But as of this post I&amp;#8217;ve just finished Ysani&amp;#8217;s restoration, and I&amp;#8217;m now well past the point (in terms of number of active galleries) at which the previous issue showed up.&lt;/p&gt;



&lt;p&gt;So &lt;em&gt;so far&lt;/em&gt; it looks like I&amp;#8217;ll no longer reproduce the issue, which is good. Though I&amp;#8217;m still a little nervous about this because I don&amp;#8217;t know &lt;em&gt;what caused the issue in the first place&lt;/em&gt;. And as a person whose career is software testing, a problem I don&amp;#8217;t have a root cause for always makes me nervous.&lt;/p&gt;



&lt;p&gt;Any number of things could have fixed it, though. Because all of these apply since the original problem occurred:&lt;/p&gt;



&lt;ul&gt;
&lt;li&gt;We had a change in internet provider&lt;/li&gt;



&lt;li&gt;Operating system updates on the server&lt;/li&gt;



&lt;li&gt;Multiple updates to WordPress&lt;/li&gt;



&lt;li&gt;Multiple updates to the FooGallery code&lt;/li&gt;



&lt;li&gt;I just installed a plugin called FileBird to help me manage the media library for this site, because I have a few thousand screenshots at this point and this makes for a very large and unwieldy library to manage without some help&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Any one of these, or any combination of these, could have stabilized things enough that I no longer reproduce the earlier issue. What&amp;#8217;ll &lt;em&gt;also&lt;/em&gt; be interesting is whether a &lt;em&gt;different&lt;/em&gt; issue I&amp;#8217;ve been seeing on the site lately starts reproducing again&amp;#8211;where galleries on older posts would render badly and I&amp;#8217;d have to clear the site&amp;#8217;s cached CSS data to make them work again.&lt;/p&gt;



&lt;p&gt;Let&amp;#8217;s hope things stay stable, anyway! Onward!&lt;/p&gt;
&lt;p style="text-align: right"&gt;&lt;small&gt;Read more on &lt;a href="https://skyrim.annathepiper.org/2023/11/21/ysanis-screenshots-now-restored/" title="Read original post."&gt;Anna Plays Skyrim&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=annathepiper&amp;ditemid=2043385" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-01:143160:1961258</id>
    <link rel="alternate" type="text/html" href="https://annathepiper.dreamwidth.org/1961258.html"/>
    <link rel="self" type="text/xml" href="https://annathepiper.dreamwidth.org/data/atom/?itemid=1961258"/>
    <title>How to Get Screenshots off a Steam Deck</title>
    <published>2022-08-27T08:19:07Z</published>
    <updated>2022-08-27T08:19:07Z</updated>
    <category term="steam deck"/>
    <category term="screenshots"/>
    <category term="warpinator"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;p&gt;We interrupt my regular playthrough posts with this important news bulletin:&lt;/p&gt;



&lt;p&gt;I FINALLY GOT MY STEAM DECK YOU GUYS! 😍 🤩 &lt;/p&gt;



&lt;p&gt;I&amp;#8217;tm about to do TWO posts about this. One with general overall impressions of the thing, and also &lt;em&gt;this&lt;/em&gt; post, which is going to be about the hoops I had to jump through in order to get at the screenshots I love to take for my playthrough posts. This did, I feel, deserve a whole separate post because it&amp;#8217;s one of the few things I &lt;em&gt;don&amp;#8217;t&lt;/em&gt; like about the Deck so far. And I wanted to write up the steps I followed for my workaround, in case any other gamers out there also finally getting Decks want to do the same thing.&lt;/p&gt;



&lt;p&gt;This is going to be long, so here&amp;#8217;s a More tag, y&amp;#8217;all:&lt;/p&gt;



&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___1" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://annathepiper.dreamwidth.org/1961258.html#cutid1"&gt;Read the rest of this entry &amp;raquo;&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___1" aria-live="assertive"&gt;&lt;/div&gt;&lt;p style="text-align: right"&gt;&lt;small&gt;Mirrored from &lt;a href="https://skyrim.annathepiper.org/2022/08/27/how-to-get-screenshots-off-a-steam-deck/" title="Read original post."&gt;Anna Plays Skyrim&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=annathepiper&amp;ditemid=1961258" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
