# Movie Watch History & Review Analysis ![[movie_analysis.png]] ## Overview I have an ongoing project of sorts where I record each movie that I watch, and then add some context to it, including an overall, subjective rating to it. The data is then parsed, analyzed with some simple C# logic, and finally displayed in a relatively ugly UI as shown in the screenshot above. It shows breakdowns by genre, year, series, and when it was last watched — among other things. It's fun to see the lists and graphs grow and change over time! However, rating something as elaborate as a film with single grade is difficult at the best of times, and some movies really challenge the idea, period. After all, how can you do an apples-to-apples comparison between something like *The King of Kong: A Fistful of Quarters* and *Unbreakable*? One person might really like one genre or actor, and strongly dislike other ones. That said, all of the grading data is completely subjective relative to my perspective and preferences towards movies in general. ## Code Samples ```csharp // Letter grades are more appealing to me than numbers or stars internal static readonly List<string> GRADE_LETTERS = new() { "F-", "F", "F+", "D-", "D", "D+", "C-", "C", "C+", "B-", "B", "B+", "A-", "A", "A+", "S", "SS", "SSS" }; // Simple helper function to turn a number grade into a letter one internal static string RatingToLetter(double rating) { try { return GRADE_LETTERS[(int)Math.Round(rating)]; } catch (Exception ex) { Console.WriteLine(ex.Message); return ""; } } ``` Originally, I used a Google Sheets spreadsheet to host the data because it was easy to access anywhere, and I could generate a publicly accessible link that the app could pull down the latest data with. ```csharp internal static async Task<List<Model>?> ReadDataFromWeb() { return await Task.Run(() => { try { using WebClient client = new WebClient(); client.Headers.Add("accept", "*/*"); byte[] outputData = client.DownloadData(Constants.DATASET_URL); string data = System.Text.Encoding.Default.GetString(outputData); string dataPath = "csvData.txt"; File.WriteAllText(dataPath, data); using StreamReader stream = new StreamReader(dataPath); using CsvReader reader = new CsvReader( stream, CultureInfo.InvariantCulture); reader.Context.RegisterClassMap<ModelClassMap>(); List<Model>? models = reader.GetRecords<Model>()?.ToList(); return models; } catch (Exception ex) { Console.WriteLine(quot;ReadDataFromWeb exception: {ex.Message}"); return null; } }); } ``` I have since transitioned entirely to using [[Obsidian]] for all of it, but the analysis app itself is still separate — it just needed to have its parsing logic updated to look elsewhere. With the introduction of [[Obsidian Bases]], I have haven't developed the C# app much further since Bases come with a lot of the functionality out of the box that I previously wrote by hand. That said, while Bases allows for a simple, high level way of viewing and editing movie notes — something that prevented me from switching over sooner — there are a lot of things missing from the Bases approach currently, such as the graphs and charts from the C# app. I really enjoy cross-referencing information about the films, and the linking feature of Obsidian really makes that easy. With that, emergent patterns in the data become more and more interesting over time! ![[movie_analysis_obsidian_base.png]] I'd highly recommend giving something like this a shot if it sounds interesting to you! I feel like it only gets more rewarding with time. #c_sharp #movies #obsidian #data_analysis #development #bases #projects